A full CRUD REST API implemented in bare-bones NodeJS (no framework like Express).
The endpoints are
GET /api/products
: get all products.GET /api/products/:id
: get the product withid
equal to:id
.POST /api/products
: create a new product (itsid
is generated by the server withuuid
).PUT /api/products/:id
: modify the product withid
equal to:id
.DELETE /api/products/:id
: delete the product withid
equal to:id
.
There's a test.rest
file for testing the endpoints. It works with the REST Client VSCode extension.
Clone the repo and run either npm start
(or npm run dev
for using nodemon
).
Thanks to Brad Traversy for his tutorial.