test
This commit is contained in:
52
main.py
Normal file
52
main.py
Normal file
@ -0,0 +1,52 @@
|
||||
from tidal_dl_ng.config import Settings, Tidal
|
||||
from tidal_dl_ng.constants import CTX_TIDAL, MediaType
|
||||
from tidal_dl_ng.download import Download
|
||||
from tidal_dl_ng.helper.path import get_format_template, path_file_settings
|
||||
from tidal_dl_ng.helper.tidal import (
|
||||
all_artist_album_ids,
|
||||
get_tidal_media_id,
|
||||
get_tidal_media_type,
|
||||
instantiate_media,
|
||||
)
|
||||
from tidal_dl_ng.helper.wrapper import LoggerWrapped
|
||||
from tidal_dl_ng.model.cfg import HelpSettings
|
||||
|
||||
from rich.live import Live
|
||||
from rich.panel import Panel
|
||||
from rich.progress import BarColumn, Console, Progress, SpinnerColumn, TextColumn
|
||||
from rich.table import Table
|
||||
|
||||
from pathlib import Path
|
||||
from typing import Annotated, Optional
|
||||
from fastapi import FastAPI, HTTPException, Depends, Request
|
||||
from fastapi.templating import Jinja2Templates
|
||||
from fastapi.staticfiles import StaticFiles
|
||||
from pydantic import BaseModel
|
||||
from typing import List, Optional
|
||||
import uvicorn
|
||||
|
||||
# Initialize FastAPI app
|
||||
app = FastAPI(
|
||||
title="FastAPI Template", description="A simple FastAPI template with basic CRUD operations", version="1.0.0"
|
||||
)
|
||||
|
||||
app.mount("/static", StaticFiles(directory="static"), name="static")
|
||||
|
||||
# Initialize Jinja2 templates
|
||||
templates = Jinja2Templates(directory="templates")
|
||||
|
||||
|
||||
# Main Landing Page
|
||||
@app.get("/")
|
||||
async def main(request: Request):
|
||||
return templates.TemplateResponse("pages/index.html", {"request": request, "title": "Home Page"})
|
||||
|
||||
|
||||
# Health check endpoint
|
||||
@app.get("/health")
|
||||
async def health_check():
|
||||
return {"status": "healthy"}
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
uvicorn.run("main:app", host="0.0.0.0", port=8000, reload=True)
|
Reference in New Issue
Block a user