This is a simple demo for a restful crud api to manage a single resource - item. The database driver is sqlite3. The database is stored entirely in memory and not saved.
To setup and run this project you need node and npm.
To start the project simply run the following commands:
npm i
npm start
There is a minimal test to check the basic functionality, you can run it with
npm test
GET /api/itemwill return a list of itemsPOST /api/itemwith required fields will create a new item and return the instance dataGET /api/item/:idretrieves a single item by idPUT /api/item/:idwill update specified fields on object with idDELETE /api/item/:iddeletes an item by specified id
PUT and POST calls require some or all fields to be filled out in request
as x-www-form-urlencoded fields:
titlemust be a stringdescriptionoptional or should be a stringstockintegerpricefloatlocationshould be a string in the format:country, city, street, lattitude, longitude