Skip to content

backend api route : get all blogs and full blog #4

@AahilRafiq

Description

@AahilRafiq

Api request : GET /api/blogs/getall

Goals

  • just return literally all blogs in DB , except the ones the user created
  • RETURN ONLY TITLES of the blogs along with blog id
  • the only thing needed is userId
  • this is a get request , use query params to pass userId in the request
  • return a JSON response along with response status
  • use authmiddleware i created as middleware to protect the route

Api request : GET /api/blogs/[blogId]

  • return full blog data
  • dont return tags for now atleast
  • this is a get request , use query params to pass userId in the request
  • return a JSON response along with response status
  • use authmiddleware i created as middleware to protect the route

Prerequisites

  • understand await and async functions in Javascript
  • or just copy other pattern
  • learn middlewares in express js

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions