Skip to content

A FastAPI application that provides REST API endpoints for creating, reading, updating and deleting blog posts from a database. Utilizes Pydantic models and optional query parameters for GET requests.

Notifications You must be signed in to change notification settings

navinfeb15/Fastapi-Blog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FastAPI Blog API

This is a basic CRUD API for a blog using FastAPI.

Endpoints

Get All Blogs

GET /blog- Fetches all blogs from the database with optional query parameters:

  • limit - limits number of blogs returned
  • published - filters published/unpublished blogs
  • sort - sorts by field

Get Single Blog

GET /blog/{id} - Fetches a single blog by its ID passed in as a path parameter

Get Blog Comments

GET /blog/{id}/comments - Gets comments for a single blog by its ID

Create Blog

POST /blog - Creates a new blog from data passed in the request body:

Copy code

{ "title": "Post title", "body": "Post body", "published": true/false }

Uses Pydantic models for data validation.

Built With

  • FastAPI
  • Pydantic
  • Python 3

Overall, this provides a starting point for a FastAPI powered blog or article API with major CRUD functionality.

About

A FastAPI application that provides REST API endpoints for creating, reading, updating and deleting blog posts from a database. Utilizes Pydantic models and optional query parameters for GET requests.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages