Before start, Clone this Repo to your own Github Profile.
- Node.js
- Serverless Framework
- MongoDB
- AWS (Lambda, API Gateway)
To start project with API, MongoDB and MongoDB Admin services, just run:
docker-compose upGET to localhost:5050/dev/hello should return Hello World!
localhost:5050- APIlocalhost:5051- MongoDB- localhost:5052 - MongoDB Admin
- Navigate to: localhost:5052
- Connection Name:
Any - Connection String:
mongodb://user:password@mongo:27017 - Press Add Connection
- Click Connect in right Action Tab, to enter.
-
Add endpoint, to CREATE document or documents to MongoDB:
POST tolocalhost:5050/dev/documentsarray of documents -
Add endpoint, to READ document or documents from MongoDB:
GET tolocalhost:5050/dev/documents/:idget array of documents or single document (by id) -
Add endpoint, to UPDATE document in MongoDB:
PUT tolocalhost:5050/dev/documents/:idwith document update -
Add endpoint, to DELETE document or documents from MongoDB:
DELETE tolocalhost:5050/dev/documents/:idwithout id, to delete all documents, or delete document by id. -
Deploy API using Serverless Framework to your AWS Account. You can use Mongo Atlas as test Database.
P.S. Will be nice, if you add some Jest Unit Tests.