refac
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
from fastapi import FastAPI, HTTPException, Body
|
||||
from fastapi.middleware.cors import CORSMiddleware
|
||||
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
from datetime import datetime, timezone
|
||||
from typing import Literal
|
||||
@@ -11,6 +14,18 @@ app = FastAPI(
|
||||
description="Provides secure UTC/local time retrieval, formatting, timezone conversion, and comparison.",
|
||||
)
|
||||
|
||||
|
||||
origins = ["*"]
|
||||
|
||||
app.add_middleware(
|
||||
CORSMiddleware,
|
||||
allow_origins=origins,
|
||||
allow_credentials=True,
|
||||
allow_methods=["*"],
|
||||
allow_headers=["*"],
|
||||
)
|
||||
|
||||
|
||||
# -------------------------------
|
||||
# Pydantic models
|
||||
# -------------------------------
|
||||
|
||||
Reference in New Issue
Block a user