We are a delivery app which takes care to delivery beers quickly and to do it we must find Points of Sale closest to our customers
Beer Delivery = Our app name
PDV = Point-of-sale
Install Docker and Docker-compose
docker-compose up -d
docker exec -it app npm test
Search
curl -X GET 'http://127.0.0.1/api/search?lng=-46.474983&lat=-23.610245'
Create PDV
curl -X POST \
http://127.0.0.1/api/pdvs/ \
-H 'Content-Type: application/json' \
-d '{
"tradingName": "Adega do Java",
"ownerName": "Joaquina Jalenta",
"document": "04.210.017/0001-09",
"coverageArea": {
"type": "MultiPolygon",
"coordinates": [
[
[
[
-8.164418,
-70.351778
]
]
]
]
},
"address": {
"type": "Point",
"coordinates": [
-8.164418,
-70.351778
]
}
}'
Get By Id
curl -X GET http://127.0.0.1/api/pdvs/{ID}
WIP
The idea here is to use AWS Lambda with API Gateway, thats why we use serverless framework
- Install serverless framework with npm
- Make sure that your aws credentials is defined
- Update the config to your MongoDB place
sls deploy