Compare commits

7 Commits

Author SHA1 Message Date
51ac6ca045 Docker-Compose with App and DB Service 2026-03-06 12:39:02 +01:00
bed9cc862e Ticket 1.3 issue resolved 2026-03-06 12:17:30 +01:00
19000f61d2 Health and Status 2026-03-06 12:02:02 +01:00
48922c063c Status ok 2026-03-06 11:50:32 +01:00
af2547b54a Min FastAPI-Server 2026-03-06 10:48:07 +01:00
5d563f8c9d standard fastapi 2026-03-06 10:04:00 +01:00
unknown
ac91dfa34e Git-Repository & Basestrukture 2026-03-06 09:27:11 +01:00
8 changed files with 27 additions and 4 deletions

10
README.md Normal file
View File

@@ -0,0 +1,10 @@
Projektname: Fastshortner
Goal: Have a properly working app that is taking the original url and shortens it
Requirements:
fastapi
uvicorn[standard]
SQLAlchemy
psycopg2-binary
python-dotenv
Starting command: uvicorn app.main:app --reload.

View File

@@ -8,9 +8,16 @@ services:
DATABASE_URL: "postgresql://user:password@db:5432/urlshort" DATABASE_URL: "postgresql://user:password@db:5432/urlshort"
depends_on: depends_on:
- db - db
networks: backend
networks:
backend:
driver: Bridge
volumes:
db_data:
db: db:
image: postgres:16 image: postgres:alpine
container_name: url_db container_name: url_db
restart: always restart: always
environment: environment:
@@ -19,6 +26,4 @@ services:
POSTGRES_DB: urlshort POSTGRES_DB: urlshort
volumes: volumes:
- db_data:/var/lib/postgresql/data - db_data:/var/lib/postgresql/data
networks: backend
volumes:
db_data:

0
src/__init__.py Normal file
View File

Binary file not shown.

0
src/app/__init__.py Normal file
View File

Binary file not shown.

Binary file not shown.

8
src/app/main.py Normal file
View File

@@ -0,0 +1,8 @@
from fastapi import FastAPI
app = FastAPI()
@app.get("/health/{Status}")
def get_health(Status: int, q: str = "ok"):
return {"Health": Status, "Status": q}