RESTful endpoint to get quotes
Tech stack
- Node.js 12, Express.js
- SQLIte 3
- AWS lambda (Serverless)
- Docker
See the detailed article I wrote on medium.com
curl -s "http://localhost:3001/tags" | python -m json.tool
[
"age",
"alone",
"amazing",
...
]
curl -s "/quotes?limit=2&tag=age" | python -m json.tool
[
{
"author": "Clive Owen",
"quote": "If you explode onto the scene at a very young age, there are so many people pulling you in different directions. It takes time to recalibrate and see what's important.",
"tag": "age"
},
{
"author": "Cindy Crawford",
"quote": "The face you have at age 25 is the face God gave you, but the face you have after 50 is the face you earned.",
"tag": "age"
}
]
docker-compose up --build
db/quotes.db
will be created based on CSV files
test with
`curl http://localhost:3001/tags`
npm test
sls deploy
- internal server error: invoke from Amazon, and the error log will show the details