API of Hotels built with Node.JS, Express.JS and MongoDB to be used in a React Native application.
- Built with Node.js and Express
- Mongoose schema
| Route | HTTP Verb | Description |
|---|---|---|
| /api/hotels | GET | Get list of hotels |
| /api/hotels/:id | GET | Get a single hotel |
| /api/hotels/search/:filter | GET | Get a list of hotels by search |
- Git
- MongoDB - Keep a running daemon with
mongod - Node.js and npm Node >= 8 LTS
-
Run
npm installto install server dependencies. -
Run
mongodin a separate shell to keep an instance of the MongoDB Daemon running. -
Example document in collection
Hotels.
{
"price": 349709,
"stars": 4,
"pictures": [
{
"url": "https://www.rwsentosa.com/-/media/project/non-gaming/rwsentosa/hotels/hard-rock-hotel-singapore/hardrockhotelsg-exterior.jpgmh=666&la=en&h=666&w=1366&mw=1366&hash=7890A13D2C4FE83769F4A571B997007215155027"
}
],
"name": "VELOS",
"phoneNumber": "+1 (948) 432-3271",
"address": "741 Clarkson Avenue, Ypsilanti, Puerto Rico, 302",
"about": "Elit officia irure qui ut tempor pariatur excepteur pariatur tempor est. Id officia velit mollit qui. Pariatur officia ex cupidatat et voluptate labore reprehenderit officia quis do do exercitation incididunt.",
"loc": [
6.223612,
-75.586811
]
}-
Run
npm run devto start the development server. It should automatically open the client in your browser when ready. -
Open browser
http://localhost:3000/api/hotels.
It is used platform as a service (PaaS), for the deployment of the API using the HEROKU CLI and following the guide.
- Maria Fernanda Serna Arboleda - FullStack JavaScript Developer - Github
See also the list of contributors who participated in this project.
This project is licensed under MIT - see the LICENSE file for details