Skip to content

A Blog app backend created using FastAPI. Can perform test queries on the provided link just replace http://localhost:8000/ with a website link mentioned below. You can perform this using Postman or curl

Notifications You must be signed in to change notification settings

joshidivanshu/Blog-Backend-using-FastAPI-JWT-Authentication

Folders and files

NameName
Last commit message
Last commit date

Latest commit

author
Divanshu Joshi
May 20, 2021
f557899 · May 20, 2021

History

1 Commit
May 20, 2021
May 20, 2021
May 20, 2021
May 20, 2021
May 20, 2021
May 20, 2021
May 20, 2021
May 20, 2021
May 20, 2021
May 20, 2021
May 20, 2021
May 20, 2021

Repository files navigation

Blog FastAPI & Jwt Authentication

An api for Blog using FastAPI

Installing Requirements

Use Virtualenv and install the packages.

pip install -r requirements.txt

Running the Project

Go to the project dir and run the below line in the terminal.

uvicorn main:app --reload

Interacting with the API

  1. To get all blogs
[GET]
http://localhost:800/blog 
Authorization : Bearer token
  1. to get a blog with id
[GET]
http://localhost:8000/blog/{blog_id}
Authorization : Bearer token
  1. To create a blog
[POST] 
http://localhost:8000/blog
in request body pass in json
{
    "title": "title of the blog",
    "body": "body of the blog"
}
Authorization : Bearer token
  1. To delete a blog
[DELETE]
http://localhost:8000/blog/{blog_id}
Authorization : Bearer token
  1. To update a blog
[PUT]
http://localhost:8000/blog/{blog_id}
in request body pass in json
{
    "title": "title of the blog",
    "body": "body of the blog"
}
Authorization : Bearer token
  1. To retrieve access token
[POST]
http://localhost:8000/login
in form passs
username & password
  1. To create a user
[POST]
http://localhost:8000/user
Authorization : Bearer token

Default Username & Password

username = divanshu
password = divanshu

About

A Blog app backend created using FastAPI. Can perform test queries on the provided link just replace http://localhost:8000/ with a website link mentioned below. You can perform this using Postman or curl

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published