This Golang application is REST API.
Frameworks used:
- Echo to build the website: https://github.com/labstack/echo
- XORM to populate the database: https://xorm.io/
Create a rest_task.ini configuration file and place it wherever you want. Configuration should look like this
[database]
host = localhost
name = postgres
password =postgres
[main]
secret_key = "RANDOMKEYGOESHERE"
put this line into ~/.bashrc file
export REST_TASK_SETTINGS=path/to/config/rest_task.ini
change path/to/config/
with your config path.
in order to run migration you need to install golang-migrate/migrate
after installing run this command from project's directory
migrate -path ./contrib/migrations/ -database "postgres://USERNAME:@localhost:5432/DBNAME?sslmode=disable" up
change USERNAME and DBNAME with you username and dbname
Run make command it will take care of rest
make
./bin/rest --help
./bin/rest serve_api