Make Backend Food Delivery App With Express.js
Food Delivery App is a simple Food Delivery 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
- Type
npm install
- 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 food_delivery, and Import file food_delivery.sql to phpmyadmin
- Open Postman desktop application or Chrome web app extension that has installed before
- Choose HTTP Method and enter request url.(ex. localhost:3000/item)
- You can see all the end point here
Open .env file on your favorite code editor, and copy paste this code below :
PORT=3000
HOST=localhost
USER=root // default
PASS= // default
DATABASE=food_delivery
NODE_ENV=development node server.js
1. GET
/:id
/restaurant/
/restaurant/:id_restaurant
/item/
(Get all Item with pagination)/item/:id:item
(get detail item by id)/carts/:id
/valuation/:item_id
/categories/
(Get All Categories)/categories/:id_categories
(Get Categories by id)/categories/detail/id_categories
(Show all item with categories id)/item/search
(Search Item By name or price or rating)/restaurant/menu/id_restaurant
(show all menu/item by id restaurant)
2. POST
-
/login
-
/logout
-
/register
-
/registerest
-
/restaurant/
-
/item/
(Add Item) -
/carts/
(Add to Cart) -
/valuation/
(Add Review and Rating) -
/categories/
(Add Categories)
3. PUT
-
/:id
(Edit User Account){ "name": "arka", "username": "Demy", "password": "arkademy", "role_id": 3 }
-
/item/:id_item
(Edit item) -
/restaurant/:id_restaurant
-
/carts/:id_carts
-
/carts/checkout/:id_carts
(CheckOut item) -
/categories/id_categories
(Edit Categories)
4. DELETE
/:id
(Delete User Account)/item/:id_item
(Delete Item)/restaurant/:id_restaurant
(Delete Restaurant)/carts/:id
(Delete Item On Cart)/categories/:id_categories
(Delete Categories)