This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from fastapi import APIRouter | |
novelroute = APIRouter() | |
@novelroute.get('/info') | |
def novels(): | |
return {"detail": "This novel info is from the novel APIRouter", | |
"name": "I am good", | |
"publication": "Kaustubh"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from fastapi import APIRouter | |
bookroute = APIRouter() | |
@bookroute.get('/info') | |
def books(): | |
return {"detail": "This book info is from the book APIRouter", | |
"name": "Hello", | |
"ISBN": "32DS3"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from fastapi import FastAPI | |
from apiv1 import apiv1 | |
from apiv2 import apiv2 | |
import uvicorn | |
app = FastAPI() | |
app.mount("/api/v1", apiv1) | |
app.mount("/api/v2", apiv2) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from fastapi import FastAPI | |
apiv2 = FastAPI() | |
@apiv2.get('/returnLocation') | |
def index(): | |
return {"Location": "India"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from fastapi import FastAPI | |
apiv1 = FastAPI() | |
@apiv1.get('/returnName') | |
def index(): | |
return {"Name": "Kaustubh demo"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from fastapi import FastAPI | |
from fastapi.middleware.wsgi import WSGIMiddleware | |
from demo_dash import dash_app | |
import uvicorn | |
app = FastAPI() | |
app.mount("/dashboard", WSGIMiddleware(dash_app.server)) | |
@app.get('/') | |
def index(): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from dash import html | |
from dash import dcc | |
import dash_bootstrap_components as dbc | |
import dash | |
dash_app = dash.Dash(__name__, | |
requests_pathname_prefix='/dashboard/', title='Kaustubh Demo') | |
header = dbc.Row( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from fastapi import FastAPI | |
from config import Settings | |
import uvicorn | |
setting = Settings() | |
app = FastAPI(openapi_url=setting.openapi_url) | |
@app.get('/') | |
def index(): | |
return "Hello: {}".format(setting.appName) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pydantic import BaseSettings | |
class Settings(BaseSettings): | |
appName: str = "Kaustubh Demo" | |
openapi_url: str = '' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask | |
app = Flask(__name__) | |
app.config['appName'] = 'Kaustubh Demo' | |
@app.route('/') | |
def index(): | |
return "Hello: {}".format(app.config['appName']) | |