Skip to content

Latest commit

 

History

History
41 lines (27 loc) · 1.07 KB

File metadata and controls

41 lines (27 loc) · 1.07 KB

API Server

We provide a very simple API server implementation in order to use the function from test codes written in other language than python (e.g. Ruby with RSpec).

Currently, the API server does not have any authentication mechanism.

Specification

We use swagger 2.0 to define the API spec (swagger definition).

The auto-generated API docs is found in docs/api/.

Launch API Server at local

Before launch API server, you have to setup your python environment.

Execute below commands at the root directory. The server will start at localhost:5000.

source venv/bin/activate
PYTHONPATH=projects FLASK_APP=./projects/bin/api.py flask run

HTTP Request Example

curl

curl -X POST -H "Content-Type: application/json" http://localhost:5000/api/inference -d "{ \"html\" : \"<input type='text' name='mail_addr' placeholder='email address'>\"}"