typeset-blog/app/views.py

28 lines
658 B
Python

# -*- encoding: utf-8 -*-
"""
Python Aplication Template
Licence: GPLv3
"""
from flask import url_for, redirect, render_template, flash, g, session
from app import app
@app.route('/')
def index():
return app.send_static_file('index.html')
@app.route('/api/addpost',methods=['POST'])
def walle_morph():
word = request.args.get('word','water')
pos_req = request.args.get('pos','N')
pos = pos_req if pos_req != '' else 'N';
return json.dumps(get_morph(word,pos))
@app.route('/api/xmlfiles')
def walle_xmlfiles():
xml_files = map(os.path.basename,glob.glob(xmlDir+'*.xml'))
return json.dumps(xml_files)
# ====================