Skip to content

YuriFontella/fastify-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fastify API Rest

Projeto demo utilizando os seguintes plugins:

  • "@fastify/auth"
  • "@fastify/autoload"
  • "@fastify/compress"
  • "@fastify/cors"
  • "fastify-guard"
  • "@fastify/helmet"
  • "@fastify/jwt"
  • "fastify-knexjs"
  • "@fastify/multipart"
  • "fastify-nodemailer"
  • "@fastify/rate-limit"
  • "fastify-socket.io"
  • "@fastify/static"
npm install

knex (postgresql)

Crie um banco de dados, modifique o arquivo knexfile.js e execute o comando:

npm run migrate

API

npm run dev

Rotas

https://httpie.io/docs#installation

http post http://localhost:3000/users name=Nome password=Senha role=Função
http get http://localhost:3000/users

Auth/JWT

http post http://localhost:3000/auth name=Nome password=Senha

Guard

http delete http://localhost:3000/users/1/delete x-access-token:token

Multipart/Upload

http -f http://localhost:3000/upload @~/avatar.jpg

Email

Configure o nodemailer em src/plugins/nodemailer.js

http post http://localhost:3000/email to=email@email.com subject=Assunto text=Mensagem

Socket.io

npm install http-server
http-server .
http post http://localhost:3000/socket message="Eu sou um socket"

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published