From c61d3228ef16d62252b401ccc829312139ee73de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Katariina=20J=C3=A4rvenm=C3=A4ki?= Date: Thu, 5 Mar 2026 21:51:21 +0200 Subject: [PATCH] Cleanup and README update --- .env.example | 2 +- README.md | 9 ++++----- app/core/config.py | 4 ++-- app/tests/test_config.py | 2 +- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/.env.example b/.env.example index d7665eb..9fd4fdb 100644 --- a/.env.example +++ b/.env.example @@ -1,3 +1,3 @@ DATABASE_URL=postgresql+psycopg2://postgres:postgres@localhost:5432/url_db -BASE_URL=http://localhost:8000 +BASE_URL=http://localhost:9995 DEBUG=True \ No newline at end of file diff --git a/README.md b/README.md index 7409153..8fa1231 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ Production-ready URL Shortener built with FastAPI, PostgreSQL, Docker, and Alembic. ![Tests](https://img.shields.io/badge/tests-passing-brightgreen) -![Coverage](https://img.shields.io/badge/coverage-90%25-brightgreen) +![Coverage](https://img.shields.io/badge/coverage-99%25-brightgreen) ![Python](https://img.shields.io/badge/python-3.12-blue) ## Techstack @@ -12,7 +12,7 @@ FastAPI, PostgreSQL, SQLAlchemy 2.0, Alembic, Docker, Pytest and Pydantic v2 ## Features -Shorten URLs, Redirect, Click tracking, Stats endpoint, Collision handling, 90%+ test coverage, Dockerized and Alembic migrations +Shorten URLs, Redirect, Click tracking, Stats endpoint, Collision handling, 99%+ test coverage, Dockerized and Alembic migrations ## Local Setup @@ -22,10 +22,9 @@ python3 -m venv venv source venv/bin/activate ``` -Create .env: +Create .env, copy as this as template: ``` -DATABASE_URL=sqlite:///./test.db -BASE_URL=http://localhost:8000 +.env.example ``` Run: diff --git a/app/core/config.py b/app/core/config.py index ec944bf..68ccb63 100644 --- a/app/core/config.py +++ b/app/core/config.py @@ -12,8 +12,8 @@ class Settings(BaseSettings): # Server settings host: str = "0.0.0.0" - port: int = 8000 - base_url: str = "http://localhost:8000" + port: int = 9995 + base_url: str = "http://localhost:9995" # Debug flag debug: bool = True diff --git a/app/tests/test_config.py b/app/tests/test_config.py index c4bbae9..5ce5a17 100644 --- a/app/tests/test_config.py +++ b/app/tests/test_config.py @@ -11,6 +11,6 @@ def test_default_settings_values(): assert settings.app_name == "URL Shortener" assert settings.host == "0.0.0.0" - assert settings.port == 8000 + assert settings.port == 9995 assert settings.debug is True assert isinstance(settings.allowed_hosts, list) \ No newline at end of file