An open API service indexing awesome lists of open source software.

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!

Awesome Lists containing this project

README

        



Project logo

NodeJS Users API - Without Frameworks And Packages

[![License](https://img.shields.io/badge/license-MIT-blue.svg)](/LICENSE)

---

## 📝 Table of Contents

- [About](#about)
- [Getting Started](#getting_started)
- [Usage](#usage)
- [Built Using](#built_using)
- [Authors](#author)


## 🧐 About

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






## 🏁 Getting Started

### Installing

```
git clone https://github.com/NathanCotrim/NodeJS-API.git
```

or - (GitHub CLI)

```
gh repo clone NathanCotrim/NodeJS-API
```

### Running

```
node src/server.js
```

## 🎈 Usage

### 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}
```


## ⛏️ Built Using

- [NodeJs](https://nodejs.org/en/) - Server Environment


## ✍️ Author - Nathan Cotrim - MIT License