- npm start
We utilized the NoSql database Mongodb. The project has been set up to work with mLab, which serves as the default cloud database for both the local and production environments. By entering a connection string in food-delivery-api/app.js, you can establish your own mLab account and connect it to your database.
Express JS contains all the configuration details related to the node server. It performs the following tasks:
- Create and start a server
- Add different middleware namely
- bodyParser: Parse body params and attache them to req.body
- Compress: Helps in decreasing the size of the response body and improve the speed of the API calls.
- JSON web token: Helps in generating an authentication token
It handles the different GraphQL routes of the application, namely
- auth: This route contains different routes related to the user such as registration of the new user, updating the user details, and managing login and logout.
- food: Manages food schema such as adding, deleting, editing, and liking food.
It handles the different REST routes of the application, namely:
- GraphQL: It handles all routes related to GraphQL.
- Paypal: It handles when payment is made using Paypal.
- Stripe: It handles when payment is made using Stripe.