Skip to content

Instantly share code, notes, and snippets.

@CognitiveDave
Created February 12, 2022 14:14
Show Gist options
  • Save CognitiveDave/ed364a87ea82cc751766e4e2effe1a04 to your computer and use it in GitHub Desktop.
Save CognitiveDave/ed364a87ea82cc751766e4e2effe1a04 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Feb 8 18:47:58 2022
@author: davidmoore
"""
import uvicorn
from fastapi import FastAPI, Request
from fastapi.responses import FileResponse
from fastapi.staticfiles import StaticFiles
app = FastAPI(title="CVBackEnd")
app.mount("/", StaticFiles(directory="./dist",html=True), name="static")
@app.get("/")
async def home():
return FileResponse("index.html")
if __name__ == "__main__":
uvicorn.run(app, host="0.0.0.0", port=8000)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment