cirruswave
Comprehensive framework for cloud based REST enabled microservices development
$ cnpm install cirruswave 
SYNC missed versions from official npm registry.

cirruswavedrawing

Comprehensive framework for cloud based REST enabled microservices development

NPM Version NPM Downloads

The cirruswave is a platform that enables development, testing and deployment of microservices in the enterprise.

Customize web services to your enterprise needs by specifying easy to read configuration files.

  • npm enabled microservices platform
  • Declarative routes for REST API
  • Optional JSON Schema based validation of url params, query params, request body and response
  • Optional accesskey based security with built in validation of keys
  • KeyMgr service to help with issuing developer accesskey and secret key.
  • Automatic documentation of the services
  • Test framework to enable easy testing of the microservices

cirruswave package does REST for you.

Installation instructions

Getting Started

Usage instructions

System Services

Auto Documentation for Micro-Services

Frequently asked questions

Schematized Micro-Services

License

Installation

npm install cirruswave

Getting Started

The package cirruswave is used to create webservices with configuration files and business logic specific to your needs.

The configurations files allow you to specify service instance, the paramters and their validation along with the security options.

To run a sample webservice, you would need

  • a service configuration file ( example: appserviceconfig.json )

  • an app configuration file ( example: appconfig.json )

  • a custom business logic for each route you expose ( example: sampleservice.js )

  • your primary file ( example: index.js )

  • in addition to this cirruswave comes with some default certificates if you want to specify a secure way to publish your webservice. These certifcates should be replaced by your organizations certificates if you want to deploy these webservices for external use.

  • The package allows your services to be tested at:


http[s]://localhost:[port]/test


The testing framework can be customized to your enterprise needs (logo, look and feel with configuration changes)

  • The package allows your services to be documented for use at:

http[s]://localhost:[port]/Documentation

Usage

Create appserviceconfig.json which contains the sampleservice configuration information

{
  "services": 
  {
    "sampleservice": {
      "protocol": "http",
      "port": 8888,
      "hostname": "localhost",
      "description": "REST END POINT For Sample Service.",
      "configfilepath": "./appconfig.json",
      "security": "nokey"
    }
  }
}

Create appconfig.json to declare the routes.

Each route configuration section has a name, route url path, description, examples, param and body schema sections etc. Most importantly it contains the type which tells what method is supported. Method values supported are 'get', 'post', 'put', 'delete', and 'static'. All methods except 'static' conform to the standard http methods and follow REST API guidelines.

The 'static' method in particular is used to server static files like css, html, client-side javascript files, images etc. The 'routeclass' in this case describes the path to the location of static files. The 'routefunction' 'paramschema', 'bodyschema', 'responseschema' are ignored for this type.

Below is a sample configuration file with a route with 'get', 'post', and 'static' methods. This configuration file could include paramschema, bodyschema and responseschema

{
    "servicename": "sampleservice",
    "routes": [
        {
          "route": "/sampleservice/images",
          "type": "static",
          "configured": true,
          "routeclass": "../examples/images",
          "description": "app specific images are served from the directory ../examples/images under route /sampleservice/images"
        },
        {
        "route": "/sampleservice/something/:value1/:value2",
        "type": "get",
        "configured": true,
        "routeclass": "./sampleservice.js",
        "routefunction": "RouteGetSomething",
        "description": "Hello world",
        "examples": [
          {
            "param": "/sampleservice/something/foo/100"
          }
        ],
        "paramschema": {
          "type": "object",
          "required": [
            "value1",
            "value2"
          ],
          "properties": {
            "value1": {
              "description": "value1 is string e.g. foo",
              "type": "string"
            },
            "value2": {
              "description": "value2 is number e.g. 100",
              "type": "integer"
            }
          }
        }
      },
      
      {
        "route": "/sampleservice/something/:value1/:value2",
        "type": "post",
        "configured": true,
        "routeclass": "./sampleservice.js",
        "routefunction": "RoutePostSomething",
        "description": "Hello world",
        "examples": [
            {
            "param": "/sampleservice/something/foo/100",
            "payload":{
              "value3":{"value5":"bar"},
              "value4":"blah"
            }
          }
        ],
        "paramschema": {
          "type": "object",
          "required": [
            "value1",
            "value2"
          ],
          "properties": {
            "value1": {
              "description": "value1 is string e.g. foo",
              "type": "string"
            },
            "value2": {
              "description": "value2 is number e.g. 100",
              "type": "integer"
            }
          }
        },
        "bodyschema": {
          "type": "object",
          "required": [
            "value3",
            "value4"
          ],
          "properties": {
            "value3": {
              "description": "value3 is an object e.g. {'value5':'bar'}",
              "type": "object",
              "required":[
              "value5" 
              ],
              "properties":{
                "value5":{
                  "description":"value5 is a string inside the value3 object e.g. bar",
                  "type":"string"
                }
              }
            },
            "value4": {
              "description": "value4 is string e.g. blah",
              "type": "string"
            }
          }
        }
      }
    ]
  
}

Create a file sampleservice.js that implements this route.


exports.RouteGetSomething = function(req,res)
{
    res.status(200).json({"value":"hello world"});
}
exports.RoutePostSomething = function(req,res)
{
    res.status(200).json({"params=":req.params,"body":req.body});
}

Create a file index.js to initialized and start cirruswave



var app = require('cirruswave');
app.startservice("sampleservice", __dirname, "./appserviceconfig.json");

Now execute the service

node index.js

You can then access this sampleservice in your browser

http://localhost:8888/sampleservice/something/foo/100 

will return

{"value":"hello world"}

In addition a POST route will be enabled

http://localhost:8888/sampleservice/something/foo/100 that takes a post with body json like this:
{
  "value3":{"value5":"bar"},
  "value4":"blah"
}

System services

Key Manager(keymgr) is one of the services that's shipped by default with the wave platform. Key Manager service provides routes for generating access and secret keys, provision access to various services which have security set as "acckey"

To see the full documentation on system services, please run the keymgr service.

To run the system services, copy the code below into a file called systemservicesindex.js

const app = require('cirruswave');
const initoptions={
 "aclconfig":"aclconfig.json",
 "secret":"helloworld",
 "appserviceconfig":"appserviceconfig.json",
 "appdir":__dirname
}

app.startsystemservice("keymgr",initoptions);

after this run the systemservice by invoking


node systemservicesindex.js

Note that the keys are stored encrypted in the file pointed to by aclconfigpath (in this case it's ./aclconfig.json).

FAQ

Installation and Setup

How do I install cirruswave package


npm install cirruswave

Can you point me to some detailed instructions to get me started 

README.md file can get you on to your first project

Which operating systems do you support

Current version is tested on MacOS, Ubuntu 18.04 and Windows 10, but we work with any operating systems that support Node.js

General questions

What are the prerequisites to use cirruswave

cirruswave is a microservices platform for NodeJS. If your code is written in javascript for NodeJS and you want to develop webservices expose REST API in a robust and secure manner, you should use cirruswave.

I am ready. Where is CirrusWave available?

CirrusWave is available as a machine image(AMI) in AWS mrketplace. You can get more information on CirrusWave AMI

I read all the information, I am ready to develop, and test robust microservices, connect to multiple datasources and deploy them to containers in secure and sclable manner. How do I get started?

Goto AWS console , Launch ec2 instance, choose AWS Marketplace, search for cirruswave, select CirrusWave-Enterprise, ssh to the machine

I launched an ec2 instance using CirrusWave-Enterprise image. How can create my first microservice

ssh to the cirruswave machine instance, cirruswave will give you the help. Also see CirrusWae Documentation to get started

Support

Where can I get support for the product

Please select the support icon on this web page and submit your ticket

Microservice Documentation

Detailed documentation for each app services started on localhost is available at the localhost:<port#> port# can be any of the app services started.

https://localhost:8888/documentation has documentation available for all app services. https://localhost:8888/services will listout each service https://localhost:8888/service/sampleservice will list each route for the sample service with detailed documentation

You can also use https://localhost:8888/test to get a form where you can test your sample service.

Documentation for the system services like keymgr are available at any port of a running system service. "keymgr" service uses port 4003 and https://localhost:4003/documentation has the documentation for the system services.

Schematized Micro-Services

json-schema is an IETF standard for defining json payloads. cirrus-wire uses json schema in defining various objects. All usage of schema is optional and is used to validate the routes, responses etc. Use of json-schema is encouraged as it makes the code more robust and also serves as documentation.

The following are some of the places where json-schema is expected to be provided by the developer of micro-services:

  • Request parameter schmea
  • Request body schema
  • Response schema
  • initilization option schema

Example of json-schema

Example use of Request schmeas are in the sampleservice in examples directory. keymgr system service uses init options schema Full json-schema sepcification can be found at https://json-schema.org/ Examples can be found at https://json-schema.org/learn/getting-started-step-by-step.html

License

{ "license" : "SEE LICENSE IN DEVLICENSE.md" }

Current Tags

  • 1.0.334                                ...           latest (a day ago)

312 Versions

  • 1.0.334                                ...           a day ago
  • 1.0.333                                ...           2 days ago
  • 1.0.332                                ...           2 days ago
  • 1.0.331                                ...           3 days ago
  • 1.0.330                                ...           8 days ago
  • 1.0.329                                ...           9 days ago
  • 1.0.328                                ...           9 days ago
  • 1.0.327                                ...           10 days ago
  • 1.0.326                                ...           10 days ago
  • 1.0.325                                ...           11 days ago
  • 1.0.324                                ...           12 days ago
  • 1.0.323                                ...           13 days ago
  • 1.0.322                                ...           13 days ago
  • 1.0.321                                ...           13 days ago
  • 1.0.320                                ...           14 days ago
  • 1.0.319                                ...           16 days ago
  • 1.0.318                                ...           19 days ago
  • 1.0.317                                ...           19 days ago
  • 1.0.316                                ...           19 days ago
  • 1.0.315                                ...           20 days ago
  • 1.0.314                                ...           20 days ago
  • 1.0.313                                ...           20 days ago
  • 1.0.312                                ...           23 days ago
  • 1.0.311                                ...           25 days ago
  • 1.0.310                                ...           a month ago
  • 1.0.309                                ...           a month ago
  • 1.0.308                                ...           a month ago
  • 1.0.307                                ...           a month ago
  • 1.0.306                                ...           a month ago
  • 1.0.305                                ...           a month ago
  • 1.0.304                                ...           a month ago
  • 1.0.303                                ...           a month ago
  • 1.0.302                                ...           a month ago
  • 1.0.301                                ...           2 months ago
  • 1.0.300                                ...           2 months ago
  • 1.0.299                                ...           2 months ago
  • 1.0.298                                ...           2 months ago
  • 1.0.297                                ...           2 months ago
  • 1.0.296                                ...           2 months ago
  • 1.0.295                                ...           2 months ago
  • 1.0.294                                ...           2 months ago
  • 1.0.293                                ...           2 months ago
  • 1.0.292                                ...           2 months ago
  • 1.0.291                                ...           2 months ago
  • 1.0.290                                ...           2 months ago
  • 1.0.289                                ...           2 months ago
  • 1.0.288                                ...           2 months ago
  • 1.0.287                                ...           2 months ago
  • 1.0.286                                ...           2 months ago
  • 1.0.285                                ...           2 months ago
  • 1.0.284                                ...           2 months ago
  • 1.0.283                                ...           2 months ago
  • 1.0.282                                ...           2 months ago
  • 1.0.281                                ...           2 months ago
  • 1.0.280                                ...           2 months ago
  • 1.0.279                                ...           2 months ago
  • 1.0.278                                ...           2 months ago
  • 1.0.277                                ...           2 months ago
  • 1.0.276                                ...           2 months ago
  • 1.0.275                                ...           2 months ago
  • 1.0.274                                ...           2 months ago
  • 1.0.273                                ...           2 months ago
  • 1.0.272                                ...           2 months ago
  • 1.0.271                                ...           2 months ago
  • 1.0.270                                ...           2 months ago
  • 1.0.269                                ...           2 months ago
  • 1.0.268                                ...           2 months ago
  • 1.0.266                                ...           2 months ago
  • 1.0.265                                ...           2 months ago
  • 1.0.259                                ...           3 months ago
  • 1.0.258                                ...           3 months ago
  • 1.0.257                                ...           3 months ago
  • 1.0.256                                ...           3 months ago
  • 1.0.255                                ...           3 months ago
  • 1.0.254                                ...           3 months ago
  • 1.0.253                                ...           3 months ago
  • 1.0.252                                ...           3 months ago
  • 1.0.251                                ...           3 months ago
  • 1.0.250                                ...           3 months ago
  • 1.0.248                                ...           3 months ago
  • 1.0.247                                ...           3 months ago
  • 1.0.246                                ...           3 months ago
  • 1.0.245                                ...           3 months ago
  • 1.0.244                                ...           3 months ago
  • 1.0.243                                ...           3 months ago
  • 1.0.242                                ...           3 months ago
  • 1.0.241                                ...           3 months ago
  • 1.0.240                                ...           3 months ago
  • 1.0.239                                ...           3 months ago
  • 1.0.238                                ...           3 months ago
  • 1.0.237                                ...           3 months ago
  • 1.0.236                                ...           3 months ago
  • 1.0.234                                ...           3 months ago
  • 1.0.232                                ...           3 months ago
  • 1.0.231                                ...           3 months ago
  • 1.0.230                                ...           3 months ago
  • 1.0.229                                ...           3 months ago
  • 1.0.228                                ...           3 months ago
  • 1.0.227                                ...           3 months ago
  • 1.0.226                                ...           3 months ago
  • 1.0.224                                ...           3 months ago
  • 1.0.223                                ...           3 months ago
  • 1.0.222                                ...           3 months ago
  • 1.0.219                                ...           3 months ago
  • 1.0.218                                ...           3 months ago
  • 1.0.217                                ...           3 months ago
  • 1.0.216                                ...           3 months ago
  • 1.0.214                                ...           3 months ago
  • 1.0.213                                ...           4 months ago
  • 1.0.212                                ...           4 months ago
  • 1.0.211                                ...           4 months ago
  • 1.0.210                                ...           4 months ago
  • 1.0.207                                ...           4 months ago
  • 1.0.206                                ...           4 months ago
  • 1.0.205                                ...           4 months ago
  • 1.0.204                                ...           4 months ago
  • 1.0.203                                ...           4 months ago
  • 1.0.202                                ...           4 months ago
  • 1.0.201                                ...           4 months ago
  • 1.0.200                                ...           4 months ago
  • 1.0.199                                ...           4 months ago
  • 1.0.198                                ...           4 months ago
  • 1.0.197                                ...           4 months ago
  • 1.0.196                                ...           5 months ago
  • 1.0.195                                ...           5 months ago
  • 1.0.194                                ...           5 months ago
  • 1.0.193                                ...           5 months ago
  • 1.0.192                                ...           5 months ago
  • 1.0.191                                ...           5 months ago
  • 1.0.190                                ...           6 months ago
  • 1.0.189                                ...           6 months ago
  • 1.0.188                                ...           6 months ago
  • 1.0.187                                ...           6 months ago
  • 1.0.186                                ...           6 months ago
  • 1.0.185                                ...           6 months ago
  • 1.0.184                                ...           6 months ago
  • 1.0.183                                ...           6 months ago
  • 1.0.182                                ...           6 months ago
  • 1.0.181                                ...           6 months ago
  • 1.0.180                                ...           6 months ago
  • 1.0.179                                ...           6 months ago
  • 1.0.178                                ...           6 months ago
  • 1.0.177                                ...           6 months ago
  • 1.0.176                                ...           6 months ago
  • 1.0.175                                ...           6 months ago
  • 1.0.174                                ...           6 months ago
  • 1.0.173                                ...           6 months ago
  • 1.0.172                                ...           6 months ago
  • 1.0.171                                ...           6 months ago
  • 1.0.170                                ...           6 months ago
  • 1.0.169                                ...           6 months ago
  • 1.0.168                                ...           6 months ago
  • 1.0.167                                ...           6 months ago
  • 1.0.166                                ...           6 months ago
  • 1.0.165                                ...           6 months ago
  • 1.0.164                                ...           6 months ago
  • 1.0.163                                ...           6 months ago
  • 1.0.162                                ...           6 months ago
  • 1.0.161                                ...           7 months ago
  • 1.0.160                                ...           7 months ago
  • 1.0.159                                ...           7 months ago
  • 1.0.158                                ...           7 months ago
  • 1.0.157                                ...           7 months ago
  • 1.0.156                                ...           7 months ago
  • 1.0.155                                ...           7 months ago
  • 1.0.154                                ...           7 months ago
  • 1.0.153                                ...           7 months ago
  • 1.0.152                                ...           7 months ago
  • 1.0.151                                ...           7 months ago
  • 1.0.150                                ...           7 months ago
  • 1.0.149                                ...           7 months ago
  • 1.0.148                                ...           7 months ago
  • 1.0.147                                ...           7 months ago
  • 1.0.146                                ...           7 months ago
  • 1.0.145                                ...           7 months ago
  • 1.0.144                                ...           8 months ago
  • 1.0.143                                ...           8 months ago
  • 1.0.142                                ...           8 months ago
  • 1.0.141                                ...           8 months ago
  • 1.0.140                                ...           8 months ago
  • 1.0.139                                ...           8 months ago
  • 1.0.138                                ...           8 months ago
  • 1.0.137                                ...           8 months ago
  • 1.0.136                                ...           8 months ago
  • 1.0.135                                ...           8 months ago
  • 1.0.134                                ...           8 months ago
  • 1.0.133                                ...           8 months ago
  • 1.0.132                                ...           8 months ago
  • 1.0.131                                ...           8 months ago
  • 1.0.130                                ...           8 months ago
  • 1.0.129                                ...           8 months ago
  • 1.0.127                                ...           8 months ago
  • 1.0.126                                ...           8 months ago
  • 1.0.125                                ...           8 months ago
  • 1.0.124                                ...           8 months ago
  • 1.0.123                                ...           8 months ago
  • 1.0.122                                ...           8 months ago
  • 1.0.121                                ...           8 months ago
  • 1.0.120                                ...           8 months ago
  • 1.0.119                                ...           8 months ago
  • 1.0.118                                ...           9 months ago
  • 1.0.117                                ...           9 months ago
  • 1.0.116                                ...           9 months ago
  • 1.0.115                                ...           9 months ago
  • 1.0.114                                ...           9 months ago
  • 1.0.113                                ...           9 months ago
  • 1.0.112                                ...           9 months ago
  • 1.0.111                                ...           9 months ago
  • 1.0.110                                ...           9 months ago
  • 1.0.109                                ...           9 months ago
  • 1.0.108                                ...           9 months ago
  • 1.0.107                                ...           9 months ago
  • 1.0.106                                ...           9 months ago
  • 1.0.105                                ...           9 months ago
  • 1.0.103                                ...           9 months ago
  • 1.0.102                                ...           9 months ago
  • 1.0.101                                ...           9 months ago
  • 1.0.100                                ...           9 months ago
  • 1.0.99                                ...           9 months ago
  • 1.0.98                                ...           9 months ago
  • 1.0.97                                ...           9 months ago
  • 1.0.96                                ...           9 months ago
  • 1.0.95                                ...           9 months ago
  • 1.0.94                                ...           9 months ago
  • 1.0.93                                ...           9 months ago
  • 1.0.92                                ...           9 months ago
  • 1.0.91                                ...           9 months ago
  • 1.0.90                                ...           9 months ago
  • 1.0.89                                ...           9 months ago
  • 1.0.88                                ...           9 months ago
  • 1.0.87                                ...           9 months ago
  • 1.0.86                                ...           9 months ago
  • 1.0.85                                ...           9 months ago
  • 1.0.84                                ...           9 months ago
  • 1.0.83                                ...           9 months ago
  • 1.0.82                                ...           9 months ago
  • 1.0.81                                ...           9 months ago
  • 1.0.80                                ...           9 months ago
  • 1.0.79                                ...           9 months ago
  • 1.0.78                                ...           9 months ago
  • 1.0.77                                ...           9 months ago
  • 1.0.76                                ...           9 months ago
  • 1.0.75                                ...           9 months ago
  • 1.0.74                                ...           9 months ago
  • 1.0.73                                ...           9 months ago
  • 1.0.72                                ...           9 months ago
  • 1.0.71                                ...           9 months ago
  • 1.0.70                                ...           9 months ago
  • 1.0.69                                ...           9 months ago
  • 1.0.68                                ...           9 months ago
  • 1.0.67                                ...           9 months ago
  • 1.0.66                                ...           9 months ago
  • 1.0.65                                ...           9 months ago
  • 1.0.64                                ...           9 months ago
  • 1.0.63                                ...           9 months ago
  • 1.0.62                                ...           9 months ago
  • 1.0.61                                ...           9 months ago
  • 1.0.60                                ...           9 months ago
  • 1.0.59                                ...           9 months ago
  • 1.0.58                                ...           9 months ago
  • 1.0.57                                ...           9 months ago
  • 1.0.56                                ...           9 months ago
  • 1.0.55                                ...           9 months ago
  • 1.0.54                                ...           9 months ago
  • 1.0.53                                ...           9 months ago
  • 1.0.52                                ...           9 months ago
  • 1.0.51                                ...           9 months ago
  • 1.0.50                                ...           9 months ago
  • 1.0.49                                ...           9 months ago
  • 1.0.48                                ...           9 months ago
  • 1.0.47                                ...           9 months ago
  • 1.0.46                                ...           9 months ago
  • 1.0.45                                ...           9 months ago
  • 1.0.44                                ...           9 months ago
  • 1.0.43                                ...           9 months ago
  • 1.0.42                                ...           9 months ago
  • 1.0.41                                ...           9 months ago
  • 1.0.40                                ...           9 months ago
  • 1.0.39                                ...           9 months ago
  • 1.0.38                                ...           9 months ago
  • 1.0.37                                ...           9 months ago
  • 1.0.36                                ...           9 months ago
  • 1.0.35                                ...           9 months ago
  • 1.0.34                                ...           9 months ago
  • 1.0.33                                ...           9 months ago
  • 1.0.32                                ...           9 months ago
  • 1.0.31                                ...           9 months ago
  • 1.0.30                                ...           9 months ago
  • 1.0.29                                ...           9 months ago
  • 1.0.28                                ...           9 months ago
  • 1.0.27                                ...           9 months ago
  • 1.0.26                                ...           9 months ago
  • 1.0.25                                ...           9 months ago
  • 1.0.24                                ...           9 months ago
  • 1.0.23                                ...           9 months ago
  • 1.0.22                                ...           9 months ago
  • 1.0.21                                ...           10 months ago
  • 1.0.20                                ...           10 months ago
  • 1.0.19                                ...           10 months ago
  • 1.0.18                                ...           10 months ago
  • 1.0.17                                ...           10 months ago
  • 1.0.16                                ...           10 months ago
  • 1.0.14                                ...           a year ago
  • 1.0.13                                ...           a year ago
  • 1.0.12                                ...           a year ago
  • 1.0.11                                ...           a year ago
  • 1.0.10                                ...           a year ago
  • 1.0.9                                ...           a year ago
  • 1.0.8                                ...           a year ago
  • 1.0.7                                ...           a year ago
  • 1.0.6                                ...           a year ago
  • 1.0.0                                ...           a year ago
Maintainers (1)
Downloads
Today 0
This Week 8
This Month 118
Last Day 8
Last Week 34
Last Month 159
Dependencies (40)
Dev Dependencies (0)
None
Dependents (1)

Copyright 2014 - 2016 © taobao.org |