https://github.com/than-dev/raw-nodejs-api
An users NodeJS API without packages libs or frameworks!
https://github.com/than-dev/raw-nodejs-api
api javascript node nodejs v8
Last synced: 25 days ago
JSON representation
An users NodeJS API without packages libs or frameworks!
- Host: GitHub
- URL: https://github.com/than-dev/raw-nodejs-api
- Owner: than-dev
- License: mit
- Created: 2021-07-21T05:46:24.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-01-02T13:51:34.000Z (over 3 years ago)
- Last Synced: 2025-03-28T19:07:40.308Z (about 1 month ago)
- Topics: api, javascript, node, nodejs, v8
- Language: JavaScript
- Homepage:
- Size: 21.5 KB
- Stars: 29
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
NodeJS Users API - Without Frameworks And Packages
[](/LICENSE)
---
## 📝 Table of Contents
- [About](#about)
- [Getting Started](#getting_started)
- [Usage](#usage)
- [Built Using](#built_using)
- [Authors](#author)
Purpose of this project was build a simple users API in a different way we see all time in nodeJS ecosystem, usually using Express, Adonis, Hapi...
I used just the native modules of nodeJS and a JSON file as DataBank, that is managed using node fs
### Installing
```
git clone https://github.com/NathanCotrim/NodeJS-API.git
```or - (GitHub CLI)
```
gh repo clone NathanCotrim/NodeJS-API
```### Running
```
node src/server.js
```### Main API Routes
#### http://localhost:3000/users
GET | List all users
#### http://localhost:3000/user/:id
GET | Get user by Id
#### http://localhost:3000/new/user
POST | Create User
Receives a JSON:
```
{
"name": "Tester",
"email": "[email protected]"
}
```
#### http://localhost:3000/update/user/:id
PATCH | Update User
Receives a JSON with new Information:
```
{
"name": "TesterUpdated", (?)
"email": "[email protected]" (?)
}
```
#### http://localhost:3000/delete/user/:id
DELETE | Delete User
### To request any route without an app use:
```
curl ${url} -X ${method}
```
- [NodeJs](https://nodejs.org/en/) - Server Environment
## ✍️ Author - Nathan Cotrim - MIT License