VILLASframework
Modular co-simulation framework
|
Code: https://git.rwth-aachen.de/acs/public/villas/web-backend-go
The backend of VILLASweb uses the programming language Go and a PostgreSQL database.
git clone git@git.rwth-aachen.de/acs/public/villas/web-backend-go.git
to copy the project on your computercd VILLASweb-backend-go
go mod tidy
go run start.go [params]
To obtain a list of available parameters use go run start.go --help
. To run the tests use go test $(go list ./... ) -p 1
in the top-level folder of the repo.
Running the backend will only work if the PostgreSQL database is setup properly. Otherwise, you will get error messages.
If you want to use test data (including some test users), you can start the backend with the parameter -mode=test
. Please check the repository of the VILLASweb-backend-go to find information on the test user login names and passwords. The testing mode is NOT intended for production deployments.
The documentation of the VILLASweb API in the OpenAPI format can be auto-generated from the source code documentation using the tool swag. To do this run the following in the top-level folder of the repo:
go mod tidy
go install github.com/swaggo/swag/cmd/swag
swag init -p pascalcase -g "start.go" -o "./doc/api/"
The .yaml
and .json
files in OpenAPI swagger format are created in the output folder doc/api
.
Please check the Readme file in the backend repository for some useful hints on the local setup of the PostreSQL database.