Skip to content

NodeJS first look simple HTTP REST API for 1 model, w/o DB

License

Notifications You must be signed in to change notification settings

madbox/nodejs-test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nodejs-test

NodeJS first look. This is a simple HTTP REST API application. One 1 model, w/o DB, all objects are stored in memory of application process. Every request logged with zeromq (works with Listener app from zeromq-exercise repo).

Ubuntu setup:

sudo apt install npm
sudo apt install node-express-generator
sudo npm install nodemon -g

express nodejs-test
cd nodejs-test
npm install

Run the App

nodemon (in app dir)

API:

  • List: curl localhost:3000/users
  • Read: curl localhost:3000/users/3
  • Delete: curl -X DELETE localhost:3000/users/4
  • Create: curl localhost:3000/users/ --data "name=maxim"
  • Update: curl localhost:3000/users/1 --data "name=newname" -X PUT

About

NodeJS first look simple HTTP REST API for 1 model, w/o DB

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages