Created
June 30, 2026 10:40
-
-
Save Maski0/454ec99c525ae56b1b1698b8fed88679 to your computer and use it in GitHub Desktop.
Template Project
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ErrorActionPreference = "Stop" | |
| if (-not (Get-Command uv -ErrorAction SilentlyContinue)) { | |
| Write-Host "uv is not installed. Install uv first." | |
| exit 1 | |
| } | |
| uv init | |
| New-Item -ItemType Directory -Force -Path "src" | Out-Null | |
| if (Test-Path "main.py") { | |
| Remove-Item "main.py" | |
| } | |
| uv add fastapi uvicorn | |
| @' | |
| from fastapi import FastAPI | |
| app = FastAPI() | |
| @app.get("/") | |
| def root(): | |
| return {"message": "FastAPI app is running"} | |
| '@ | Set-Content "src/main.py" | |
| Write-Host "Done. Run with:" | |
| Write-Host "uv run uvicorn src.main:app --reload" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env sh | |
| set -eu | |
| if ! command -v uv >/dev/null 2>&1; then | |
| echo "uv is not installed. Install uv first." | |
| exit 1 | |
| fi | |
| uv init | |
| mkdir -p src | |
| rm -f main.py | |
| uv add fastapi uvicorn | |
| cat > src/main.py <<'EOF' | |
| from fastapi import FastAPI | |
| app = FastAPI() | |
| @app.get("/") | |
| def root(): | |
| return {"message": "FastAPI app is running"} | |
| EOF | |
| echo "Done. Run with:" | |
| echo "uv run uvicorn src.main:app --reload" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment