Sweet Room RESTfull API is application specially for backend only. Built with NodeJs using the ExpressJs Framework. Express.js is a web application framework for Node.js. More about Express
- Open app's directory in CMD or Terminal
- If you Dont have nodemon. You can install with type
npm install -g nodemon
- And install depedencies with type
yarn
- Make new file a called .env, set up first here
- Turn on Web Server and MySQL can using Third-party tool like xampp, etc.
- Create a database with the name sweet_room, and Import file sweet_room.sql to phpmyadmin
- Start app's with type
yarn start
- Open Postman desktop application or Chrome web app extension that has installed before
- Choose HTTP Method and enter request url.(ex. localhost:3006/hotel)
- You can see all the end point here
Open .env file on your favorite code editor, and copy paste this code below :
HOST=localhost
USER=root // default
PASS= // default
DATABASE=sweet_room
SECRET_KEY = 'your secretkey'
PORT = 1010
REDISCLOUD_URL = 'Your redis url'
BASIC_TOKEN = 'Your Basic Token Xendit'
1. GET
/hotel
(Get all data of hotel)/hotel/data/4
(Get 4 data of new hotel)/hotel/search/:keyword
(Get data with search by city and hotel name)/hotel/:id
(Get hotel by specific id)/hotel/mitra/:id
(Get hotel by specific mitra)/room
(Get all data of room)/room/:id
(Get room by specific id)/reservation/:id
(Get data reservation by id)/reservation/place/:hotel_id
(Find place data reservation by hotel id)/reservation/user/:user_id
(Find data reservation by user id)/reservation/history/a
(Find data history reservation)/reservation/history/hotel/:id
(Find data hotel reservation by id)/reservation/latest/a
(Find new data reservation)/user/profile
(get data profile)/user/allemail/a
(get all data email)/facility/
(get all data facility)/facility/:id
(get data facility by id)/favorite/
(get all data favorite)/favorite/:id
(get data favorite by id)/feedback/
(get all data feedback)/feedback/:id
(get data feedback by id)
2. POST
/hotel
(Add new hotel)/room
(Add new room)/reservation/makeStatusSuccess/:id
(For check reservation hotel)/reservation/makeStatusCancel
(For make reservation hotel status)/reservation/insert/:hotel_id
(For reservation hotel)/user/login
(Login users or mitra)/user/register
(Add new users)/user/mitra
(Add new mitra)/facility/
(Add data facility)/favorite/
(Add data favorite)/feedback/
(Add data feedback)
3. PATCH
/hotel/:id
(Update hotel by id)/room/:id
(Update room by id)/reservation/checkin/:id
(Update reservation checkin by id)/reservation/checkout/:id
(Update reservation checkout by id)/user/:id
(update data profile users or mitra)/facility/:id
(update data facility by id)/favorite/:id
(update data favorite by id)/feedback/:id
(update data feedback by id)
4. DELETE
/hotel/:id
(Delete hotel by id)/room/:id
(Delete room by id)/reservation/delete/:id
(Delete reservation by id)/user/:id
(delete data users or mitra by id)/facility/:id
(delete data facility by id)/favorite/:id
(delete data favorite by id)/feedback/:id
(delete data feedback by id)