Test project. The project runs by default on port 1323
You must create or edit the env.yml file with the following content.
host:
port: 1323
driver_name: postgres
database_dsn:
Example:
host:
port: 1323
driver_name: postgres
database_dsn: postgres://teravision:[email protected]/teravision
The first step is to execute
go get -v
go run main.go
Or
sh build.sh && docker-compose up
sh build.sh
or
go build -o bin/teravision
To insert a new item you must make the following request
@host = http://127.0.0.1:1323
PUT {{host}}/api/users
Content-Type: application/json
{
"name": "julio torres",
"dni": "12826254",
"date": "1990-04-30"
}
in curl
host="http://127.0.0.1:1323"
curl -X PUT $host/api/users -H "Content-Type: application/json" \
--data '{"name": "julio torres","dni": "12826254","date":"1990-04-30"}'
- You must edit the postgresql.conf postgres pg_hba.conf files to allow traffic from the container.
- The database must exist, however, the tables are generated automatically when you start the project.