-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from BianorAraujo/develop
Develop
- Loading branch information
Showing
5 changed files
with
360 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
# node-backend-task | ||
|
||
Backend repository for a Tasks application in NodeJs | ||
|
||
Repositório do backend para uma aplicação de Tarefas em NodeJs | ||
|
||
|
||
You can access the api here: [Tasks API - Node js](https://mobiletasks.herokuapp.com/api-docs) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,337 @@ | ||
{ | ||
"openapi": "3.0.1", | ||
"info": { | ||
"version": "1.1.0", | ||
"title": "Tasks API - Node js", | ||
"description": "API for Tasks application", | ||
"contact": { | ||
"name": "Bianor Araujo", | ||
"email": "[email protected]" | ||
} | ||
}, | ||
"servers": [ | ||
{ | ||
"url": "http://localhost:3000/", | ||
"description": "Local server" | ||
}, | ||
{ | ||
"url": "https://mobiletasks.herokuapp.com/", | ||
"description": "Testing server" | ||
} | ||
], | ||
"tags": [ | ||
{ | ||
"name": "Signup" | ||
}, | ||
{ | ||
"name": "Signin" | ||
}, | ||
{ | ||
"name": "Tasks" | ||
} | ||
], | ||
"paths": { | ||
"/signup": { | ||
"post": { | ||
"security": { }, | ||
"description": "Register a new user to be able to use the api", | ||
"tags":[ | ||
"Signup" | ||
], | ||
"requestBody": { | ||
"description":"A JSON object containing the properties below", | ||
"required":"true", | ||
"content":{ | ||
"application/json":{ | ||
"schema":{ | ||
"type":"object", | ||
"required":[ | ||
"name", | ||
"email", | ||
"password" | ||
], | ||
"properties":{ | ||
"name":{ | ||
"type":"string" | ||
}, | ||
"email":{ | ||
"type":"string" | ||
}, | ||
"password":{ | ||
"type":"string" | ||
} | ||
}, | ||
"example": { | ||
"name": "Joao", | ||
"email": "[email protected]", | ||
"password": "123!@#" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"responses": { | ||
"200": { | ||
"description": "Successful operation", | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"type":"object", | ||
"required":[ | ||
"name", | ||
"email", | ||
"token" | ||
], | ||
"properties":{ | ||
"name":{ | ||
"type":"string" | ||
}, | ||
"email":{ | ||
"type":"string" | ||
}, | ||
"token":{ | ||
"type":"string" | ||
} | ||
}, | ||
"example": { | ||
"name": "Joao", | ||
"email": "[email protected]", | ||
"token": "ayJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6M30.4vWyUiu2Ry4heP8EZKBSt6ZDV3BSvxWLxZbC4YbE7b9" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"/signin": { | ||
"post":{ | ||
"security": { }, | ||
"description": "Logs the user into the system and returns the access token", | ||
"tags": [ | ||
"Signin" | ||
], | ||
"requestBody": { | ||
"description":"A JSON object containing the properties below", | ||
"required":"true", | ||
"content":{ | ||
"application/json":{ | ||
"schema":{ | ||
"type":"object", | ||
"required":[ | ||
"email", | ||
"password" | ||
], | ||
"properties":{ | ||
"email":{ | ||
"type":"string" | ||
}, | ||
"password":{ | ||
"type":"string" | ||
} | ||
}, | ||
"example": { | ||
"email": "[email protected]", | ||
"password": "123!@#" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"responses": { | ||
"200": { | ||
"description": "Successful operation", | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"type":"object", | ||
"required":[ | ||
"name", | ||
"email", | ||
"token" | ||
], | ||
"properties":{ | ||
"name":{ | ||
"type":"string" | ||
}, | ||
"email":{ | ||
"type":"string" | ||
}, | ||
"token":{ | ||
"type":"string" | ||
} | ||
}, | ||
"example": { | ||
"name": "Joao", | ||
"email": "[email protected]", | ||
"token": "ayJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6M30.4vWyUiu2Ry4heP8EZKBSt6ZDV3BSvxWLxZbC4YbE7b9" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"/tasks": { | ||
"get": { | ||
"description": "Get tasks registered by a user", | ||
"tags": [ | ||
"Tasks" | ||
], | ||
"responses": { | ||
"200": { | ||
"description": "Successful operation", | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"type":"object", | ||
"required":[ | ||
"id", | ||
"desc", | ||
"estimateAt", | ||
"doneAt", | ||
"userId" | ||
], | ||
"properties":{ | ||
"id":{ | ||
"type":"integer" | ||
}, | ||
"desc":{ | ||
"type":"string" | ||
}, | ||
"estimateAt":{ | ||
"type":"datetime" | ||
}, | ||
"doneAt":{ | ||
"type":"datetime" | ||
}, | ||
"userId":{ | ||
"type":"integer" | ||
} | ||
}, | ||
"example": { | ||
"id": 7, | ||
"desc": "Tarefa 1", | ||
"estimateAt": "2020-08-26T03:00:00.000Z", | ||
"doneAt": null, | ||
"userId": 2 | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"post": { | ||
"description": "Save your tasks", | ||
"tags": [ | ||
"Tasks" | ||
], | ||
"requestBody": { | ||
"description":"A JSON object containing the properties below", | ||
"required":"true", | ||
"content":{ | ||
"application/json":{ | ||
"schema":{ | ||
"type":"object", | ||
"required":[ | ||
"desc", | ||
"estimateAt" | ||
], | ||
"properties":{ | ||
"desc":{ | ||
"type":"string" | ||
}, | ||
"estimateAt":{ | ||
"type":"string" | ||
} | ||
}, | ||
"example": { | ||
"desc": "Tarefa 1", | ||
"estimateAt": "2020-08-26" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"responses": { | ||
"204": { | ||
"description": "No Content", | ||
"content": { | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"/tasks/{id}/toggle": { | ||
"put": { | ||
"description": "Toggle a task between completed and not completed.", | ||
"tags": [ | ||
"Tasks" | ||
], | ||
"parameters": [ | ||
{ | ||
"in": "path", | ||
"name": "id", | ||
"description": "Task id", | ||
"required": true, | ||
"schema": { | ||
"type": "integer", | ||
"default": 1 | ||
} | ||
} | ||
], | ||
"responses": { | ||
"204": { | ||
"description": "No Content", | ||
"content": { | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"/tasks/{id}": { | ||
"delete": { | ||
"description": "Delete tasks registered by a user", | ||
"tags": [ | ||
"Tasks" | ||
], | ||
"parameters": [ | ||
{ | ||
"in": "path", | ||
"name": "id", | ||
"description": "Task id", | ||
"required": true, | ||
"schema": { | ||
"type": "integer", | ||
"default": 1 | ||
} | ||
} | ||
], | ||
"responses": { | ||
"204": { | ||
"description": "No Content", | ||
"content": { | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"components": { | ||
"securitySchemes": { | ||
"bearerAuth": { | ||
"type": "http", | ||
"scheme": "bearer", | ||
"bearerFormat": "JWT" | ||
} | ||
} | ||
}, | ||
"security": [ | ||
{ | ||
"bearerAuth": [] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters