Skip to content

POC de TypeScript para um app de gerenciamento de conteúdos salvos para ver depois.

Notifications You must be signed in to change notification settings

larissadalimar/seelater-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

See Later API

Back-end for See later, an app for save contents to "see later".

About

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.

How to run for development

  1. Clone this repository
  2. Install all dependencies
npm i
  1. Create a PostgreSQL database with whatever name you want
  2. Configure the .env file using the .env.example file
  3. Run the back-end in a development environment:
npm run dev

Routes of API

All routes begin with /contents

  1. POST: /
  • Save a new content

Body:

{
  "name": "PostgresQL Cheatsheet to see",
  "comment": "the best", //opcional
  "link": "https://google.com",
  "typeShow": "diagramed"
}
  1. 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"
  }
]
  1. 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"
}
  1. 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"
  }
]
  1. 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
}
  1. DELETE: \:id
  • Delete the saved content with id equal the params and if it no exists give 404 status code.

About

POC de TypeScript para um app de gerenciamento de conteúdos salvos para ver depois.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published