A RESTful API built in NodeJS. for fetch restaurants data.
Fork and clone this repository. Instructions here.
Install all the dependencies by executing the following command:
npm installBefore running API server, you should set the database config with yours or set the database config with my values on db.config.js
const URI = process.env.MONGODB_URI || "mongodb://127.0.0.1:27017/tailorHubChallenge";Once the database is connected, you can seed the database with restaurants by executing the following command:
npm run seedsAnd finally, to run de REST API execute the following command:
npm start|
├── config // Integrations configuration and routes map
├── controllers // Handle endpoints request
├── data // Data to seed
├── middlewares // Authentication middlewares
├── models // Data models
├── seeds // Configuration to run seeds
├── templates // Email templates
└── app.js // App configuration
GET&/: Auth form screenPOST&/register: Register requestGET&/activate/:token: Activate account with token previously emailedPOST&/login: Login requestGET&/login/google: Auth with Google requestGET&/auth/google/callback: Do the authentication with GoogleGET&/users/me: Get the user logged in
GET&/restaurant/list: Get all restaurantsGET&/restaurant/:id: Get one restaurantGET&/restaurant/list/:user: Get restaurants posted by a specific userPOST&/restaurant/create: Create a restaurantPOST&/restaurant/edit: Edit a specific restaurantDELETE&/restaurant/delete/:id: Delete a specific restaurant
GET&/favourite/:user: Get all favourites restaurants of a specific userGET&/favourite/:restaurant/:user: Get one favourite restaurant of a specific userPOST&/favourite/create: Add a new favourite restaurantDELETE&/favourite/delete/:restaurant/:user: Delete a restaurant previously saved