Skip to content

charles-silva/ignite-template-trabalhando-com-middlewares

Repository files navigation

Chapter I - Desafio 02: Trabalhando com middlewares 🚀 💜

🎯 Objetivo

Adicionar o tipo de plano do usuário no desafio anterior por meio de middlewares.

✅ Requisitos

Middlewares

  • checksExistsUserAccount
  • checksCreateTodosUserAvailability
  • checksTodoExists
  • checksTodoExists

Específicação dos testes

  • Should be able to find user by username in header and pass it to request.user
  • Should not be able to find a non existing user by username in header
  • Should be able to let user create a new todo when is in free plan and have less than ten todos
  • Should not be able to let user create a new todo when is not Pro and already have ten todos
  • Should be able to let user create infinite new todos when is in Pro plan
  • Should be able to put user and todo in request when both exits
  • Should not be able to put user and todo in request when user does not exists
  • Should not be able to put user and todo in request when todo id is not uuid
  • Should not be able to put user and todo in request when todo does not exists
  • Should be able to find user by id route param and pass it to request.user
  • Should not be able to pass user to request.user when it does not exists

💻 Instalação

# Clone este repositório
$ git clone https://github.com/charles-silva/ignite-template-trabalhando-com-middlewares.git

# Entre na pasta
$ cd ignite-template-trabalhando-com-middlewares

# Instale as dependências
$ yarn ou yarn install

# Execute a aplicação em modo de desenvolvimento
$ yarn dev

# O servidor inciará na porta:3333
acesse <http://localhost:3333>

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published