mensa-parser/app.py

18 lines
308 B
Python
Raw Normal View History

2022-04-23 10:15:17 +02:00
from flask import Flask, abort
import parsers
import utils
app = Flask(__name__)
parsers.define_parsers()
@app.route('/mensa/<parser_name>/<mensa_name>')
def mensa(parser_name, mensa_name):
try:
return utils.get_parser(parser_name).parse(mensa_name)
except KeyError:
abort(404)