Giter Club home page Giter Club logo

joshidivanshu / blog-backend-using-fastapi-jwt-authentication Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 7 KB

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

Home Page: https://ohogkv.deta.dev/

Python 96.20% Mako 3.80%
fastapi sqlite3 sqlaclhemy alembic asychronous jwt-authentication jose-jwt oauth2 python-3 webdevelopment

blog-backend-using-fastapi-jwt-authentication's Introduction

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

blog-backend-using-fastapi-jwt-authentication's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.