Microservice query language
Clone or download
andreclaudino Update README.md
Add Telegram groups to Readme.md
Latest commit feb84b8 Aug 6, 2018

README.md

Build Status

restQL-server is a server to run restQL queries, making easy to fetch information from multiple services in the most efficient manner. e.g:

from search
    with
        role = "hero"

from hero as heroList
    with
        name = search.results.name

Links

Who're talking about restQL

Getting Started

Running restQL Server

restQL Server allows you to post ad-hoc queries and to reference resources pre-configured in the server startup.

  1. Download the latest release in the release page,
  2. Unzip the package,
  3. Edit the file env.sh with the resources you want to invoke,
  4. Run bin/run.sh.

Post to http://your-server.ip:9000/run-query the body below and content-type text/plain:

curl -H "Content-Type: text/plain" localhost:9000/run-query -d "from planets as allPlanets" 

Next steps

  1. Learn restQL query language,
  2. Get involved :) We're looking for contributors, if you're interested ping ricardo.mayerhofer@b2wdigital.com

Help and community

If you need help you can reach the community on Telegram

Source and Docker

Building From Source Code

As prerequisites to build restQL-server from source we need:

  • Java 8
  • Leiningen

Build the server using the build script: scripts/build-dist.sh.

The building script will create a folder dist where you can configure your resources on the file dist/bin/env.sh and run the server using the script dist/bin/run.sh.

If you want to deploy restQL-server, copy the files under the generated dist folder and start the server using the start script above.

Running as a Docker container

Building Docker image

restQL-server can also be run as a Docker container. First, from the root folder, build a Docker image with the command:

docker build -t restql-server-img .

Running the container

Than run the image as a container with the command:

docker run -p 9000:9000 -e JAVA_OPTS="-Dmongo-url=mongodb://my-mongo-ip:27017/restql-server -Dplanets=http://swapi.co/api/planets/" restql-server-img

You can register your APIs as resources by passing them in JAVA_OPTS environment variable, as seen above. The server default port is 9000 but it can be changed by passing the PORT environment variable with the desired port.

The MongoDB instance can also run from a container. If that's the case you can link to it and use its link name as the address:

docker run -p 27017-27017 --name mongo-docker mongo
docker run --link mongo-docker -p 9000:9000 -e JAVA_OPTS="-Dmongo-url=mongodb://mongo-docker:27017/restql-server -Dplanets=http://swapi.co/api/planets/" restql-server-img

The MongoDB dependency is optional and is used to run saved queries.

License

Copyright © 2016-2017 B2W Digital

Distributed under the MIT License.