GithubHelp home page GithubHelp logo

ed-silverio-mr-booleano / mamboo-test-backend Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 378 KB

This is a repo for apply a mid-backend position on Mamboo

License: MIT License

JavaScript 1.37% TypeScript 98.15% Shell 0.37% Procfile 0.11%

mamboo-test-backend's Introduction

Edmilson Silvério

API REST usando EXPRESS | MongoDB | Clean Architecture | TDD | Conventional Commit | Typescript

mamboo-test-backend

This is a repo for apply a mid-backend position on Mamboo

Este é um desafio de construção de uma API REST.

Instalar a app

npm install or yarn

Fazer o build

npm build or yarn build

Utilizar a API remotamente

https://mamboo-test-backend.herokuapp.com/tasks

Configurar a base de dados

criar a DB `TASKS_DB` e a COLLECTION `tasks` num servidor MongoDB 

Mudar os dados de acesso a base de dados no arquivo .env, tais como: URI, COLLECTION e PORT

Executar a app

npm start or yarn start

Build app

yarn buid or npm build
yarn start

REST API

A REST API deste aplicativo é descrita abaixo.

Get: Listar todas as tarefas

Request

GET /tasks

'application/json' http://localhost:PORT/tasks | https://mamboo-test-backend.herokuapp.com/tasks

Response

X-Powered-By: Express
Content-Type: application/json; charset=utf-8
Content-Length: 41
ETag: W/"29-yg9ElDIFi3l2DpUh535KUpXmtlg"
Date: Thu, 23 Dec 2021 10:10:39 GMT
Connection: keep-alive


[
  {
    "id": "62cd43e94e246398545c0c3a",
    "name": "Mamboo Api 1.23.1",
    "startDate": "02-11-2024",
    "finishDate": "03-12-2025",
    "status": "done"
  },
  {
    "id": "62cd69ac12bb2ff10e0770c8",
    "name": "Mamboo Api New 1.0.1",
    "startDate": "02-11-2024",
    "finishDate": "03-12-2025",
    "status": "to do"
  }
]

Criar uma nova tarefa

Request

POST /tasks/

'application/json' http://localhost:PORT/tasks | https://mamboo-test-backend.herokuapp.com/tasks

{
  "name": "Mamboo Api New 1.0.1",
  "startDate": "02-11-2024",
  "finishDate": "03-12-2025",
  "status": "to do"
}

Response

X-Powered-By: Express
Content-Type: application/json; charset=utf-8
Content-Length: 41
ETag: W/"29-WLapzflntobtY4yW3SAOfZgk+8Q"
Date: Thu, 23 Dec 2021 12:29:49 GMT
Connection: keep-alive

{ "message": "Created" }

Actualizar uma tarefa

Request

UPDATE /tasks/

'application/json' http://localhost:PORT/tasks | https://mamboo-test-backend.herokuapp.com/tasks/<62cc9cd8bc7836bbcf89b909>

{
  "name": "Mamboo Api New 1.0.1",
  "startDate": "02-11-2024",
  "finishDate": "03-12-2025",
  "status": "to do"
}

Response

X-Powered-By: Express
Content-Type: application/json; charset=utf-8
Content-Length: 41
ETag: W/"29-WLapzflntobtY4yW3SAOfZgk+8Q"
Date: Thu, 23 Dec 2021 12:29:49 GMT
Connection: keep-alive

{ "message": "Updated" }

Eliminar nova tarefa

Request

DELETE /tasks/

'application/json' http://localhost:PORT/tasks | https://mamboo-test-backend.herokuapp.com/tasks/<id>

Response

X-Powered-By: Express
Content-Type: application/json; charset=utf-8
Content-Length: 41
ETag: W/"29-WLapzflntobtY4yW3SAOfZgk+8Q"
Date: Thu, 23 Dec 2021 12:29:49 GMT
Connection: keep-alive

{ "message": "Deleted" }

mamboo-test-backend's People

Contributors

ed-silverio-mr-booleano avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.