feat: Make it a web application #10
@ -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:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user