-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2559b43
commit 8940771
Showing
1 changed file
with
14 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,32 @@ | ||
# Swagger generated server | ||
# TERRA-REF Breeder's API | ||
|
||
## Overview | ||
This server was generated by the [swagger-codegen](https://github.com/swagger-api/swagger-codegen) project. By using the | ||
[OpenAPI-Spec](https://github.com/swagger-api/swagger-core/wiki) from a remote server, you can easily generate a server stub. This | ||
is an example of building a swagger-enabled Flask server. | ||
This repository contains preliminary work torward a BRAPI implementation | ||
for TERRA-REF. | ||
|
||
This example uses the [Connexion](https://github.com/zalando/connexion) library on top of Flask. | ||
|
||
The server code was generated using [swagger-codegen](https://github.com/swagger-api/swagger-codegen). | ||
|
||
## Requirements | ||
Python 3.5.2+ | ||
|
||
## Usage | ||
To run the server, please execute the following from the root directory: | ||
To run, first start an intance of the BETY database: | ||
|
||
``` | ||
pip3 install -r requirements.txt | ||
python3 -m bety_brapi | ||
docker run -n betydb -d -p 5432:5432 terraref/bety-postgis | ||
``` | ||
|
||
and open your browser to here: | ||
|
||
Install the python requirements and start the Flask server: | ||
``` | ||
http://localhost:8080/brapi/v1/ui/ | ||
pip3 install -r requirements.txt | ||
./run.sh | ||
``` | ||
|
||
Your Swagger definition lives here: | ||
|
||
``` | ||
http://localhost:8080/brapi/v1/swagger.json | ||
``` | ||
then open your browser to here: | ||
|
||
To launch the integration tests, use tox: | ||
``` | ||
sudo pip install tox | ||
tox | ||
http://localhost:8080/brapi/v1/ui/ | ||
``` | ||
|
||
## Running with Docker | ||
|
||
To run the server on a Docker container, please execute the following from the root directory: | ||
|
||
```bash | ||
# building the image | ||
docker build -t bety_brapi . | ||
|
||
# starting up a container | ||
docker run -p 8080:8080 bety_brapi | ||
``` | ||
The only call implemented is the `GET phenotypes-search` with a very very | ||
preliminary mapping of BETY fields to BRAPI objects. |