- Golang version 1.14 or above
-
Clone the repository to your local machine.
$ git clone [email protected]:sakshi29/getir-test.git
-
To run all test cases in the repo, use command
$ go test ./...
-
To run application, use command inside
cmd/getir-app
$ go build $ ./getir-app OR $ go run app.go
It will start serving the application on http://localhost:9000
To check your application is up and running.
curl http://localhost:9000/healthcheck
This application is also being served on Heroku under the domain.
https://thawing-garden-76297.herokuapp.com
-
Getting documents from mongoDB
curl -X POST 'https://thawing-garden-76297.herokuapp.com/documents' \ --header 'Content-Type: application/json' \ --data-raw '{ "startDate": "2015-01-26", "endDate": "2018-02-02", "minCount": 2000, "maxCount": 2788 }'
-
Add a record to In-Memory Database
curl -X POST 'https://thawing-garden-76297.herokuapp.com/in-memory' \ --header 'Content-Type: text/plain' \ --data-raw '{ "key":"active-tabs", "value":"getir" }'
-
Fetch a record from In-Memory Database
curl -X GET 'https://thawing-garden-76297.herokuapp.com/in-memory?key=active-tabs'