https://github.com/kacper1263/node.js-api-lowdb
Simple API supporting database (lowdb) with users.
https://github.com/kacper1263/node.js-api-lowdb
api-server database example express expressjs json lowdb
Last synced: 12 months ago
JSON representation
Simple API supporting database (lowdb) with users.
- Host: GitHub
- URL: https://github.com/kacper1263/node.js-api-lowdb
- Owner: Kacper1263
- License: mit
- Created: 2019-08-24T14:10:13.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-12-11T03:08:24.000Z (about 3 years ago)
- Last Synced: 2025-01-06T07:52:36.261Z (about 1 year ago)
- Topics: api-server, database, example, express, expressjs, json, lowdb
- Language: JavaScript
- Size: 108 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Node.js API supporting database (lowdb) with users
## You don't have public IP for API?
Try [second branch with localtunnel](https://github.com/Kacper1263/node.js-API-lowdb/tree/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](https://www.npmjs.com/package/lowdb) as a database.