-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
36 lines (29 loc) · 1.11 KB
/
main.py
File metadata and controls
36 lines (29 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
from fastapi import FastAPI
from app.api.chat_endpoints import router as chatbot_router
from app.api.user_endpoints import router as user_router
from fastapi.responses import FileResponse
from fastapi.staticfiles import StaticFiles
app = FastAPI(
title="HR Chatbot App",
description="An AI-powered chatbot for simulating a software engineering interview.",
version="1.0.0"
)
app.mount("/home", StaticFiles(directory="frontend/home_page"), name="home")
app.include_router(chatbot_router, prefix="/api")
app.include_router(user_router, prefix="/api")
app.mount("/static", StaticFiles(directory="frontend/static"), name="static")
@app.get("/")
def redirect_to_home():
return FileResponse("frontend/home_page/index.html")
@app.get("/register")
def serve_register():
return FileResponse("frontend/templates/register.html")
@app.get("/login")
def serve_login():
return FileResponse("frontend/templates/login.html")
@app.get("/chat")
async def get_chat_page():
return FileResponse("frontend/templates/chat.html")
if __name__ == "__main__":
import uvicorn
uvicorn.run(app, host="0.0.0.0", port=8000)