Compare commits
7 Commits
master
...
feature/te
| Author | SHA1 | Date | |
|---|---|---|---|
| 51ac6ca045 | |||
| bed9cc862e | |||
| 19000f61d2 | |||
| 48922c063c | |||
| af2547b54a | |||
| 5d563f8c9d | |||
|
|
ac91dfa34e |
10
README.md
Normal file
10
README.md
Normal 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.
|
||||
@@ -8,9 +8,16 @@ services:
|
||||
DATABASE_URL: "postgresql://user:password@db:5432/urlshort"
|
||||
depends_on:
|
||||
- db
|
||||
networks: backend
|
||||
networks:
|
||||
backend:
|
||||
driver: Bridge
|
||||
|
||||
volumes:
|
||||
db_data:
|
||||
|
||||
db:
|
||||
image: postgres:16
|
||||
image: postgres:alpine
|
||||
container_name: url_db
|
||||
restart: always
|
||||
environment:
|
||||
@@ -19,6 +26,4 @@ services:
|
||||
POSTGRES_DB: urlshort
|
||||
volumes:
|
||||
- db_data:/var/lib/postgresql/data
|
||||
|
||||
volumes:
|
||||
db_data:
|
||||
networks: backend
|
||||
|
||||
0
src/__init__.py
Normal file
0
src/__init__.py
Normal file
BIN
src/__pycache__/__init__.cpython-311.pyc
Normal file
BIN
src/__pycache__/__init__.cpython-311.pyc
Normal file
Binary file not shown.
0
src/app/__init__.py
Normal file
0
src/app/__init__.py
Normal file
BIN
src/app/__pycache__/__init__.cpython-311.pyc
Normal file
BIN
src/app/__pycache__/__init__.cpython-311.pyc
Normal file
Binary file not shown.
BIN
src/app/__pycache__/main.cpython-311.pyc
Normal file
BIN
src/app/__pycache__/main.cpython-311.pyc
Normal file
Binary file not shown.
8
src/app/main.py
Normal file
8
src/app/main.py
Normal 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}
|
||||
Reference in New Issue
Block a user