Skip to content

ansman58/blog-api-3mtt

Repository files navigation

Welcome to the Blog API

Render Link

Visit

API Routes Not Requiring Authentication

  • GET All Articles /articles

  • GET A Single Article /articles/:id

  • POST Register an Account /auth/register

  • POST Login /auth/ogin

API Routes Requiring Authentication

  • GET All posts from author /articles/author/:id
  • POST Create an Article /articles
  • PATCH Update an Article created by you /articles/:id
  • DELETE An article created by you /articles/:id

Entity Relationship Diagram (ERD)

ER Diagram

Fields for POST Request

REGISTER

{
"first_name": "Emmanuel",
"last_name": "Doe",
"email": "[email protected]",
"password": "12345678"
}
LOGIN
    {
"email": "[email protected]",
"password": "12345678"
}
Create Blog Article
{
  "title": "My First Blog Post",
  "description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
  "body": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
  "tags": ["Lorem", "Ipsum", "Dolor"]
}

Queries For GET All Endpoints

GET /articles

{
    Filter By State:
     <!-- Case insensitive -->

    /articles?state=PUBLISHED
    /articles?state=DRAFT

   Pagination Queries:
    /articles?limit=10
    /articles?page=1

    Ordering (default is "desc"):
    /articles?read_count=asc
    /articles?reading_time=asc
    /articles?createdAt=asc
    /articles?updatedAt=asc

}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published