/blog-api

Creating REST APIs with Express, MongoDB, and Mongoose. Adding session-based authentication using Passport.js.

Primary LanguageTypeScript

Blog API

Description

[App] Creating my own APIs for my blog on my personal website

See it live on https://radiant-ocean-64037.herokuapp.com/posts Or clone repo, cd into repo, then run "npm run dev"

Purpose

Creating an API for my blog posts. Allows me to store my blog posts inside of a MongoDB database and use an admin dashboard to display content

Beyond that, other learning outcomes were:

  • Using TypeScript with Express
  • Making RESTful APIs
  • Using Passport.js with the Local Strategy using sessions and cookies to authenticate myself

Features

  1. Allows users to fetch posts and create posts
  2. Allows users to fetch a post
  3. Allows me to update and delete posts
  4. Allows users to create comments
  5. Allows me to update and delete comments
  6. Returns JSON data

Development

Technologies used

Areas for Improvement

  • Write an endpoint that allows me to search for posts

Known Bugs

  1. Returns a 502 Gateway when making a POST request