23 lines
417 B
Python
23 lines
417 B
Python
# SPDX-License-Identifier: CC0-1.0
|
|
|
|
from flask import abort, Flask
|
|
from month_num_convert import MonthNumConvert
|
|
|
|
app = Flask(__name__)
|
|
mnc = MonthNumConvert()
|
|
|
|
|
|
@app.route("/")
|
|
def hello_world():
|
|
return "<p>Hello, World!</p>"
|
|
|
|
|
|
@app.route("/<something>")
|
|
def handle_input(something):
|
|
a = mnc.convert(something)
|
|
if a == None:
|
|
abort(404)
|
|
if type(a) == type(1):
|
|
a = str(a)
|
|
|
|
return a
|