node v8
mysql
postman
- Create a database using mysql named "inventory"
- Check and Edit(if nessesary) the database config file (database_config.json) located at database folder
- update the config file base on the configuration of your mysql eg. mysql username and password
- Open command line and navigate to the project folder
- run
node app.js
and wait for the app to start up - use postman to do api call on http://localhost:3000
-
GET: /api/inventory
- accepts and requires id as parameter
- search on the model using id as search field
-
PUT: /api/inventory
- accepts and requires name,qty,amount as parameters
- create a new model using the provided parameters
- updates the model if the name is already existing
-
POST: /api/inventory
- accepts and requires id as parameter
- accepts (but optional) name,qty,amount as parameters
- Update a new model using the provided paramters
-
Delete: /api/inventory
- accepts and requires id as parameter
- Delete a new model using the provided id paramter
-
Get: /api/inventory/all
- get all the saved Item models on the database