feat: Make it a web application #10

Merged
typosaurus merged 6 commits from typosaurus/9-make-it-a-web-application into main 2026-07-26 21:51:20 +02:00
Showing only changes of commit 5515714ae6 - Show all commits

View File

@ -1,5 +1,7 @@
# retoor <retoor@molodetz.nl>
import os
from flask import Flask
from flask import jsonify
from flask import make_response
@ -14,6 +16,13 @@ from src.calculator import subtract
app = Flask(__name__)
@app.route('/')
def index() -> Response:
index_path = os.path.join(os.path.dirname(__file__), 'index.html')
with open(index_path) as f:
return make_response(f.read(), 200, {'Content-Type': 'text/html'})
@app.route('/add', methods=['GET'])
def add_route() -> Response:
try: