Refer here
From project root directory run:
$ go build -o survey-platform cmd/main.go
$ ./survey-platform
Alternatively, you can run the application after running tests with a single command if GNU Make is installed
$ make all
The API docs for this application can be found here as a postman collection. The environment required for the collection is added here
The default value for APP_PORT
is 8000.
It can be overridden by setting environment variable APP_PORT
to the required port.
From project root directory run:
$ go test -cover -race ./...
Run
$ docker-compose up
This will build docker and run application in a docker container.
Port mapping is done from 8000:8000
In case need to change the port on host, change the first argument to the required port, like 9000:8000
swag init -g cmd/main.go
Run server and go to http://localhost:8080/swagger/index.html from browser
No particular database is used for this application. On application exit, the current data is dumped to a json file to persist the data so that it will be loaded in the subsequent app run.
As an extension, if a db needs to be added it can be added easily into the repo layer with minimal changes as another implementation
While running in docker mode, volume mapping needs to considered for persisting the file to host machine