Skip to content

pratapaprasanna/nomad

Repository files navigation

Dependencies

Nomad

Business logic for nomad comes here.

Working Stack

  • Python
  • Docker
  • mongo

Web-framework to be used

Local Setup

Run
  • Create a virtual environment

  • pip install poetry

  • poetry install

  • uvicorn nomad.main:app --reload --host=0.0.0.0

Working APIs

Curl request to add new places to the db

curl --request POST \
  --url http://192.168.0.180:8000/place \
  --header 'Authorization: Bearer b53dd7a1' \
  --header 'Basic: ' \
  --header 'Content-Type: application/json' \
  --data '{
	"name": "imax",
	"city": "hyderabad",
	"pincode": "500044",
	"state": "telangana",
	"rating": 3.75
}'

Sample Response

Screenshot 2021-09-08 at 12 17 22 AM

Curl request to get all the list of places given a state

curl --request GET \
  --url http://192.168.0.180:8000/destinations \
  --header 'Authorization: Bearer b53dd7a1' \
  --header 'Content-Type: application/json' \
  --data '{
	"state": "Telangana"
}'

Sample Response

Screenshot 2021-09-08 at 12 16 51 AM

Wrong auth-key

curl --request GET \
  --url http://192.168.0.180:8000/destinations \
  --header 'Authorization: Bearer b53dd7a' \
  --header 'Content-Type: application/json' \
  --data '{
	"state": "Telangana"
}'

Response

Screenshot 2021-09-20 at 1 17 06 PM

Missin auth-key

curl --request GET \
  --url http://192.168.0.180:8000/destinations \
  --header 'Authorization: Bearer ' \
  --header 'Content-Type: application/json' \
  --data '{
	"state": "Telangana"
}'

Response

Screenshot 2021-09-20 at 1 19 56 PM

Documentation

here

About

Business logic for the nomad

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published