Back-end for See later, an app for save contents to "see later".
See later started like a POC in TypeScript with the objective to be used like an app to manage your contents saved to see, read or listen later.
- Clone this repository
- Install all dependencies
npm i
- Create a PostgreSQL database with whatever name you want
- Configure the
.env
file using the.env.example
file - Run the back-end in a development environment:
npm run dev
All routes begin with /contents
- POST:
/
- Save a new content
Body:
{
"name": "PostgresQL Cheatsheet to see",
"comment": "the best", //opcional
"link": "https://google.com",
"typeShow": "diagramed"
}
- GET ALL :
/
- Get all saved contents
Response:
[
{
"id": 6,
"link": "https://goo.com",
"typeShow": "diagramed",
"statusConsume": "tosee",
"createdAt": "2023-01-24T16:31:27.408Z",
"updatedAt": "2023-01-24T16:31:27.408Z",
"comment": "the best",
"name": "PostgresQL Cheatsheet"
},
{
"id": 5,
"link": "https://google.com",
"typeShow": "diagramed",
"statusConsume": "tosee",
"createdAt": "2023-01-24T16:31:06.878Z",
"updatedAt": "2023-01-24T16:31:06.878Z",
"comment": "the best",
"name": "PostgresQL Cheatsheet to see"
}
]
- Get By Id:
/:id
- Get the content with id or give 404 status if the content with this id not exists
Response
{
"id": 6,
"link": "https://goo.com",
"typeShow": "diagramed",
"statusConsume": "tosee",
"createdAt": "2023-01-24T16:31:27.408Z",
"updatedAt": "2023-01-24T16:31:27.408Z",
"comment": "the best",
"name": "PostgresQL Cheatsheet"
}
- Get By status:
/status/:status
- Get the contents with the status equal the params. In this app, the content can be at "to see", "seeing" or "seen" status.
[
{
"id": 6,
"link": "https://goo.com",
"typeShow": "diagramed",
"statusConsume": "tosee",
"createdAt": "2023-01-24T16:31:27.408Z",
"updatedAt": "2023-01-24T16:31:27.408Z",
"comment": "the best",
"name": "PostgresQL Cheatsheet"
},
{
"id": 5,
"link": "https://google.com",
"typeShow": "diagramed",
"statusConsume": "tosee",
"createdAt": "2023-01-24T16:31:06.878Z",
"updatedAt": "2023-01-24T16:31:06.878Z",
"comment": "the best",
"name": "PostgresQL Cheatsheet to see"
}
]
- PUT:
/:id
- Update the saved content with id equal the params and if it no exists give 404 status code.
Body:
{
"name": "PostgresQL Cheatsheet", //opcional
"comment": "the best", //opcional
"status": "seeing" //opcional
}
- DELETE:
\:id
- Delete the saved content with id equal the params and if it no exists give 404 status code.