<filename>app/main.py
from fastapi import FastAPI, Request
from fastapi.responses import HTMLResponse
from fastapi.staticfiles import StaticFiles
from fastapi.templating import Jinja2Templates

from .routes import map

app = FastAPI(docs_url='/apidocs', redoc_url=None)

templates = Jinja2Templates(directory="templates")
app.mount("/static", StaticFiles(directory="static"), name="static")

app.include_router(map.router)

@app.get("/", response_class=HTMLResponse)
async def home(request: Request):
    return templates.TemplateResponse("index.html", {"request": request})

@app.get("/curahhujan", response_class=HTMLResponse)
async def home(request: Request):
    return templates.TemplateResponse("curahhujan.html", {"request": request})

@app.get("/tma", response_class=HTMLResponse)
async def home(request: Request):
    return templates.TemplateResponse("tma.html", {"request": request})

@app.get("/rembesan", response_class=HTMLResponse)
async def home(request: Request):
    return templates.TemplateResponse("rembesan.html", {"request": request})

@app.get("/telegram", response_class=HTMLResponse)
async def home(request: Request):
    return templates.TemplateResponse("telegram.html", {"request": request})

@app.get("/alarm", response_class=HTMLResponse)
async def home(request: Request):
    return templates.TemplateResponse("alarm.html", {"request": request})

@app.get("/admin/super", response_class=HTMLResponse)
async def home(request: Request):
    return templates.TemplateResponse("admin_super.html", {"request": request})


@app.get("/login", response_class=HTMLResponse)
async def login(request: Request):
    return templates.TemplateResponse("login.html", {"request": request})

@app.get("/page/{page_name}", response_class=HTMLResponse)
async def page(request: Request, page_name: str):
    data = {
        "page": page_name
    }
    return templates.TemplateResponse("page.html", {"request": request, "data": data})

<filename>app/main.py
from fastapi import FastAPI, Request
from fastapi.responses import HTMLResponse
from fastapi.staticfiles import StaticFiles
from fastapi.templating import Jinja2Templates

from .routes import map

app = FastAPI(docs_url='/apidocs', redoc_url=None)

templates = Jinja2Templates(directory="templates")
app.mount("/static", StaticFiles(directory="static"), name="static")

app.include_router(map.router)

@app.get("/", response_class=HTMLResponse)
async def home(request: Request):
    return templates.TemplateResponse("index.html", {"request": request})

@app.get("/curahhujan", response_class=HTMLResponse)
async def home(request: Request):
    return templates.TemplateResponse("curahhujan.html", {"request": request})

@app.get("/tma", response_class=HTMLResponse)
async def home(request: Request):
    return templates.TemplateResponse("tma.html", {"request": request})

@app.get("/rembesan", response_class=HTMLResponse)
async def home(request: Request):
    return templates.TemplateResponse("rembesan.html", {"request": request})

@app.get("/telegram", response_class=HTMLResponse)
async def home(request: Request):
    return templates.TemplateResponse("telegram.html", {"request": request})

@app.get("/alarm", response_class=HTMLResponse)
async def home(request: Request):
    return templates.TemplateResponse("alarm.html", {"request": request})

@app.get("/admin/super", response_class=HTMLResponse)
async def home(request: Request):
    return templates.TemplateResponse("admin_super.html", {"request": request})


@app.get("/login", response_class=HTMLResponse)
async def login(request: Request):
    return templates.TemplateResponse("login.html", {"request": request})

@app.get("/page/{page_name}", response_class=HTMLResponse)
async def page(request: Request, page_name: str):
    data = {
        "page": page_name
    }
    return templates.TemplateResponse("page.html", {"request": request, "data": data})
