1.2.3 • Published 5 years ago
food-server v1.2.3
What is this?
Runs simple server
Installation
npm i food-server
Then...
package.json
"scripts": {
"server": "nodemon <path to file>"
}
const server = require('food-server')
const port = 8080;
server(port);
options
Server support following options(functionaly will be growing with time):
- // Products //
- GET /products - shows an array of all avaiable products
- GET /produuts/id - shows product(obj) with unique id
- GET /products?ids=id,id,id - shows an array of products with id's
- GET /products?cat=category,category - shows and array of products with matched categories
- // Users //
- GET /user/id - shows the user with unique id
- POST /user - creates new user
- POST /user - (form-data) possibility to appload an image to user
- // Orders //
- POST /orders - creates an order, requires user's and products id's