Redmine #1835: added setup and test call for api

This commit is contained in:
Cyprian Laskowski 2021-02-22 09:05:14 +01:00
parent e087add763
commit d88809be8d
3 changed files with 25 additions and 0 deletions

10
package/setup.py Normal file
View File

@ -0,0 +1,10 @@
from setuptools import setup
setup(name='structure_assignment',
version='0.1',
description='Pipeline for parsing and assigning structures to arbitrary Slovenian strings',
url='',
author='Cyprian Laskowski',
author_email='cyp@cjvt.si',
packages=['structure_assignment'],
zip_safe=True)

View File

View File

@ -0,0 +1,15 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
import os
from flask import Flask, jsonify, make_response, request
from flask_httpauth import HTTPBasicAuth
app = Flask(__name__)
api_prefix = os.environ['API_PREFIX']
@app.route(api_prefix + '/test/<string:string>', methods=['GET'])
def test(string):
results = {'input':string}
return jsonify(results)