项目作者: bullgit

项目描述 :
boolean as a service
高级语言: JavaScript
项目地址: git://github.com/bullgit/baas.git
创建时间: 2017-02-14T16:35:14Z
项目社区:https://github.com/bullgit/baas

开源协议:MIT License

下载


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.

  1. {"boolean": true}

/false

Returns a “false” boolean in JSON.

  1. {"boolean": false}

/random

Returns a random boolean in JSON.

Response:
Can be true or false

  1. {"boolean": true}
  1. {"boolean": false}

All other requests will return the default baas description.

  1. {
  2. "baas": "boolean as a service",
  3. "endpoints": {
  4. "/true": "returns true",
  5. "/false": "returns false",
  6. "/random": "returns random boolean"
  7. },
  8. "boolean": "none"
  9. }

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.

  1. $ 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.