start working with api

This commit is contained in:
Ivanov Matvey 2025-01-24 02:00:04 +10:00
parent 1f8815fc5d
commit 9462dd4465
5 changed files with 50 additions and 1 deletions

2
.gitignore vendored
View File

@ -99,7 +99,7 @@ ipython_config.py
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
#uv.lock
*.lock
# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.

1
api/.python-version Normal file
View File

@ -0,0 +1 @@
3.12.5

3
api/README.md Normal file
View File

@ -0,0 +1,3 @@
# api
Describe your project here.

26
api/pyproject.toml Normal file
View File

@ -0,0 +1,26 @@
[project]
name = "api"
version = "0.1.0"
description = "Add your description here"
authors = [
{ name = "matv864", email = "matv864@gmail.com" }
]
dependencies = [
"fastapi[standard]>=0.115.7",
]
readme = "README.md"
requires-python = ">= 3.12"
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.rye]
managed = true
dev-dependencies = []
[tool.hatch.metadata]
allow-direct-references = true
[tool.hatch.build.targets.wheel]
packages = ["src/api"]

19
api/src/app.py Normal file
View File

@ -0,0 +1,19 @@
from fastapi import APIRouter, FastAPI
from fastapi.middleware.cors import CORSMiddleware
app = FastAPI(
title="hatiko-api",
)
app.add_middleware(
CORSMiddleware,
allow_origins=["*"],
allow_methods=["*"],
allow_headers=["*"],
)
main_app_router = APIRouter(prefix="/api")
app.include_router(main_app_router)