From d88809be8de5e0b077dd711aed10338c93daa90d Mon Sep 17 00:00:00 2001 From: Cyprian Laskowski Date: Mon, 22 Feb 2021 09:05:14 +0100 Subject: [PATCH] Redmine #1835: added setup and test call for api --- package/setup.py | 10 ++++++++++ package/structure_assignment/__init__.py | 0 package/structure_assignment/api.py | 15 +++++++++++++++ 3 files changed, 25 insertions(+) create mode 100644 package/setup.py create mode 100644 package/structure_assignment/__init__.py create mode 100644 package/structure_assignment/api.py diff --git a/package/setup.py b/package/setup.py new file mode 100644 index 0000000..7c98063 --- /dev/null +++ b/package/setup.py @@ -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) diff --git a/package/structure_assignment/__init__.py b/package/structure_assignment/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/package/structure_assignment/api.py b/package/structure_assignment/api.py new file mode 100644 index 0000000..98ac595 --- /dev/null +++ b/package/structure_assignment/api.py @@ -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/', methods=['GET']) +def test(string): + results = {'input':string} + return jsonify(results)