-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
pappac
authored and
pappac
committed
Aug 8, 2024
0 parents
commit c013f1c
Showing
28 changed files
with
63 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/.venv/ | ||
/.idea/ | ||
.dockerignore | ||
.gitignore | ||
Dockerfile |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/.venv/ | ||
/.idea/ |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
FROM python:alpine | ||
RUN apk update | ||
|
||
|
||
ENV APP_HOST='0.0.0.0' \ | ||
APP_PORT='8080' \ | ||
APP_DEBUG_MODE=True | ||
|
||
|
||
|
||
WORKDIR /app | ||
|
||
COPY . . | ||
|
||
RUN pip install -r requirements.txt | ||
|
||
ENTRYPOINT ["python","-m", "server.app"] |
Empty file.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
flask==3.0.3 |
Empty file.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
from flask import Flask | ||
from server.config import Config | ||
from server.register_blueprints import register_blueprints | ||
app = Flask(__name__) | ||
app.config.from_object(Config) | ||
|
||
if __name__ == '__main__': | ||
register_blueprints(app) | ||
app.run(host=app.config.get('APP_HOST'), port=app.config.get('APP_PORT'), debug=app.config.get('APP_DEBUG_MODE')) |
Empty file.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from flask import Blueprint, jsonify | ||
from ..services.health_service import get_basic_health | ||
|
||
index = Blueprint('index', __name__) | ||
|
||
|
||
@index.route("/") | ||
def hello_world(): | ||
health = {"internal": get_basic_health(1)} | ||
return jsonify(health) | ||
|
||
@index.route("/level/<level>") | ||
def byebye_world(level): | ||
health = {"internal": get_basic_health(int(level))} | ||
return jsonify(health) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import os | ||
|
||
class Config: | ||
APP_HOST=os.environ['APP_HOST'] | ||
APP_PORT=os.environ['APP_PORT'] | ||
APP_DEBUG_MODE=os.environ['APP_DEBUG_MODE'] |
Empty file.
Empty file.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
from .blueprints.index import index | ||
|
||
def register_blueprints(app): | ||
app.register_blueprint(index) |
Empty file.
Binary file not shown.
Binary file not shown.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
def get_basic_health(level: int) -> dict: | ||
if level == 1: | ||
return {"status": "ok"} | ||
return {"status": "ok", "services": "ok"} |
Empty file.