Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bieanimaton/nlw-heat-server
Servidor desenvolvido com NodeJS, Typescript e várias bibliotecas. - Next Level Week (NLW) Heat by Rocketseat.
https://github.com/bieanimaton/nlw-heat-server
axios cors express http-server jsonwebtoken migrations nodejs prisma prisma-client server socket-io sqlite ts-node-dev
Last synced: about 1 month ago
JSON representation
Servidor desenvolvido com NodeJS, Typescript e várias bibliotecas. - Next Level Week (NLW) Heat by Rocketseat.
- Host: GitHub
- URL: https://github.com/bieanimaton/nlw-heat-server
- Owner: BieAnimaton
- Created: 2022-07-12T19:29:31.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-07-13T00:26:17.000Z (over 2 years ago)
- Last Synced: 2024-07-30T17:55:22.596Z (5 months ago)
- Topics: axios, cors, express, http-server, jsonwebtoken, migrations, nodejs, prisma, prisma-client, server, socket-io, sqlite, ts-node-dev
- Language: JavaScript
- Homepage: https://nlw-heat-server-bie.herokuapp.com/
- Size: 59.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# NLW Heat Server
## API Documentation :books:
#### Base URL
```
http://localhost:4000
```
## GET:
#### Return all user informations.
```
GET /profile
```
| Parameter | Type | Description |
| :---------- | :--------- | :---------------------------------- |
| `bearer token` (HEADER AUTH)| `string` | **Mandatory**. Token for user confirmation. |#### Return the last 3 messages from database.
```
GET /messages/last3
```## POST:
#### Creates a new message on database with relation by user (through Token).
```
POST /messages
```
| Parameter | Type | Description |
| :---------- | :--------- | :---------------------------------- |
| `message` (BODY)| `string` | **Mandatory**. User message. |
| `bearer token` (HEADER AUTH)| `string` | **Mandatory**. Token for verify each user. |#### Authenticates the user for post messages.
```
POST /authenticate
```
| Parameter | Type | Description |
| :---------- | :--------- | :------------------------------------------ |
| `code` (BODY)| `string` | **Mandatory**. The code inserted is the same as returned by GitHub Oauth, following the link: http://localhost:4000/github. |## How Install :bookmark_tabs:
```
# Create folder for store the files, like 'nlw-heat-server'# Clone the project
git clone https://github.com/BieAnimaton/nlw-heat-server# To install all libraries
yarn# To start
yarn dev# The server will start in port 4000
# Access http://localhost:4000
```## Features :hammer_and_wrench:
- NodeJs
- Typescript
- Express
- Prisma
- Cors
- Dotenv
- Jsonwebtoken
- Axios
- Socket.io