Skip to content

Kacper1263/node.js-API-lowdb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

70 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Node.js API supporting database (lowdb) with users


You don't have public IP for API?

Try second branch with localtunnel


How to install

  • Clone repo
  • Go to main folder (with app.js)
  • Edit tunnel config in app.js
  • Run npm install from command line

How to run

  • Run node app.js in the main folder

API usage

Get all users

Send GET request to .../api/v2/users

Get one user

  • Send GET request to .../api/v2/users/:id
  • Send GET request to .../api/v2/users/:name (It will take the first user it finds!)

e.g. localhost:5000/api/v2/users/4 or localhost:5000/api/v2/users/kacper

Add user

Send POST request to .../api/v2/users/

In body provide:

  • name
  • description

Delete user

Send DELETE request to .../api/v2/users/:id

Edit user data

Send PUT request to .../api/v2/users/:id
In body provide name or description. Information that will not be given will be loaded from the old content

Delete all users

Send DELETE request to .../api/v2/users/
Your IP must be registered do delete all users

Register

Send GET requiest to .../api/v2/register/
This will register your public IP


The project uses lowdb as a database.

Releases

No releases published

Packages

No packages published