Overview
This project is based on nameofthetool, <short description of the tool>
<Short description about the aim of this REST-API>
This REST API was developed in order to be use in a microservice architecture.
Example
To … :
Request :
GET <endpoint with parameters>
Response :
If the file is found, the response will contain …
If …
Other examples are available in the Examples page.
Installation
You can install this API by different ways.
Locally
You can install the API on your machine to use it locally.
For that, the management tool Maven is required. If you don’t already have it, you can, on Linux, download it with the following command :
$ sudo apt install maven
Once Maven is installed, the following step is to clone the git repository :
$ git clone https://git.mesocentre.uca.fr/unh-metabocloud/<tool>-api.git
Move into the newly created folder <name of the folder>
and launch the following command to compile the REST API into a JAR (.jar) :
$ cd <name of the folder>
$ mvn -Dmaven.test.skip=true package
Note
The option -Dmaven.test.skip=true
enables to launch the application without running the unit tests.
If you want to execute the tests, you just have to remove it or set the option to false
.
Then you can run the application from the newly created JAR :
$ java -jar target/<name of the application>-<version of the application>.jar
. . note:
By default, the application is launched on port ``<default port>`` with the log level set to ``INFO``. But you can configure both parameters.
* Use the option ``-Dserver.port`` to choose the port on which you want the application to listen :
.. code-block:: console
$ java -Dserver.port=8080 -jar target/<name of the application>-<version of the application>.jar
* Use the option ``--debug`` to run the application in ``DEBUG`` level :
.. code-block:: console
$ java -jar target/<name of the application>-<version of the application>.jar --debug
* You can of course use both options in the same time :
.. code-block:: console
$ java -Dserver.port=8080 -jar target/<name of the application>-<version of the application>.jar --debug
*The application will then be launched in debug mode on the port 8080.*
With Docker
You can also launch the application by building a Docker image from the Dockerfile
. This method enables to build a container with the application
and all the required dependencies in a single command.
First, clone the git repository if not already done :
$ git clone https://git.mesocentre.uca.fr/unh-metabocloud/<tool>-api.git
Then move into the repository and run the bash script build_docker_image.sh :
$ cd <tool>-api
$ ./build_docker_image.sh
You can now launched the application from the docker image :
$ docker run -p <default port>:<default port> <tool>
Note
You can also parameter the port and the log level :
$ docker run -e DEBUG=true -p 8080:<default port> inchi
This command will launched the application on the port 8080 in debug mode.
Web usage
You can use this application locally on your machine after installing it as explained in the section above, but you can also use it directly from the
MetaboCloud Web Portal by querying it at the following domain : https://metabocloud.mesocentre.uca.fr/<tool>/
See the Swagger documentation below for details of the endpoints available.
Documentation
You can find information on the use of this REST API :
Here on this documentation, for the generic information about the API and some examples of use.
On the Swagger documentation for the information about the different endpoints available such as accepted requests, required parameters, possible responses, as well as examples.
References
Publication Quote 1
Publication Quote 2