title | description | tags | |||
---|---|---|---|---|---|
Chi |
A Chi server for Hemli API |
|
- Install dependencies
$ go get -d ./...
- navigate to the cmd directory
$ cd .\cmd\
- run the application
$ go run .
- Hemli API uses Postgresql as main database source. In order to have an up and running postgres DB make sure you have docker installed on your local machine.Run following command to have postgres container up and running.
$ docker-compose up -d
- Once database is up and running, run migrations to have required tables created.
Please note: in order to run sql-migrate and all migration commands, you need to have pre-installed CLI tools. More information and instalation instructions check in official documentation.
$ make migrate-up
- similarly you can run following command to rollback all migrations
$ make migrate-down
- In order to create a new migration file, run following command in your terminal.
$ sql-migrate new MY_TABLE