Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/andresilveira1/rocketnotes-api

A Rest API build with Node.js.
https://github.com/andresilveira1/rocketnotes-api

cors dotenv express jsonwebtoken knex nodejs sqlite sqlite3

Last synced: about 11 hours ago
JSON representation

A Rest API build with Node.js.

Awesome Lists containing this project

README

        

RocketNotes Backend

A Rest API build with Node.js and Express. On this API you can create a account and have a place to save your personal notes.

### FronEnd repository: [Link](https://github.com/andresilveira1/rocketnotes-web)

## Technologies

- Node.js
- Express
- SQLite
- Knex
- Cors
- JWT

## Requisites

- [Node.js](https://nodejs.org/en)

## Setup

- Clone the repository;
- Install dependencies (`npm install`)
- Run application (`npm run dev`)


#

HTTP

##

User

### POST`/users`

Create a new user.

#### Request body

```json
{
"name": "username",
"email": "[email protected]",
"password": "123456"
}
```

### PUT`/users`

Update user. ID will be taken from token via request.

#### Request body

```json
{
"name": "username",
"email": "[email protected]",
"old_password": "123456",
"password": "123"
}
```

### PATCH`/users/avatar`

Upload or Update avatar. ID will be taken from token via request. Avatar filename will be taken from request and saved on database.

#### Authentication: `/sessions`

```json
{
"email": "[email protected]",
"password": "123456"
}
```

##

Notes

### POST`/notes`

Create a note. User ID will be taken from token via request.

```json
{
"title": "Introduction to Nodejs",
"description": "This is a example.",
"tags": ["node", "express"],
"links": ["link1", "link2"]
}
```

### GET`/notes?`

Get a note by title or tag. User ID will be taken from token via request.

```http
user_id=1&title=xxx&tags=xxx
```

### GET`/notes/:id`

Show all notes. User ID will be taken from token via reuqest.

### DELETE`/notes/:id`

Delete a note. User ID will be taken from token via request.

##

Tags

### GET`/tags`

List all tags. User ID will be taken from token via request to get all tags.


[![MIT License](https://img.shields.io/badge/License-MIT-green.svg)](https://choosealicense.com/licenses/mit/)