First Golang API using Granitic
- Index route to list all the people info (/people GET)
- Create route to create a person (/people POST)
- Update route to make changes (/people/ PUT)
- Using CSV File
- Using Local Dynamodb
To get started with dynamodb locally, there are couple of commands in the Makefile. So, in console run these commands:
-
Install dynamo using Docker.
$ make install-dynamo
-
Start dynamo with shared db and inMemory configuration
$ make start-dynamo
-
Create table in the dynamodb
$ make local-table-create
-
Download the dependencies
$ go mod download
-
Use following command to start the server
$ grnc-yaml-bind && go build && ./peopleapi
Goto common.yml configuration and change the following lines
storeMechanism:
type: stores.DynamodbStore
Name: conf:Service.DynamoStore
Region: us-west-2
Endpoint: http://localhost:8000
To
storeMechanism:
type: stores.FileStore
Name: conf:Service.CSVStore
- Add validation on Update API
- Add tests
- Refactor
Thank you all mentors who guided me through Go lang and Granitic