Skip to content

bullgit/baas

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

baas

boolean as a service

Usage

Run node index.js or npm start to start the server. The baas service will run on port 8000 by default. You can also use the Docker Image kevingimbel/baas. See the Docker description below for more information.

Config

Inside config.js a port can be specified. This is the port the HTTP Server will bind to.

HTTP API

/true

Returns a "true" boolean in JSON.

{"boolean": true}

/false

Returns a "false" boolean in JSON.

{"boolean": false}

/random

Returns a random boolean in JSON.

Response: Can be true or false

{"boolean": true}
{"boolean": false}

All other requests will return the default baas description.

{
  "baas": "boolean as a service",
  "endpoints": {
    "/true": "returns true",
    "/false": "returns false",
    "/random": "returns random boolean"
  },
  "boolean": "none"
}

Docker

baas is available as Docker image on Docker Hub at kevingimbel/baas. This is the official Docker image for baas.

Usage

The Docker image uses the default config.js file and exposes port 8000. To usea different port, run the image with the -p flag like shown below.

$ docker run --rm -d -p "1337:8000" kevingimbel/baas

The above command will make baas available at port 1337. Open localhost:1337 to see the baas default page.