npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

botsample

v1.37.0

Published

Starter-Kit for Bot

Downloads

4

Readme

Starter-Kit Rainbow SDK for Node.JS

Welcome to the Alcatel-Lucent Enterprise Starter-Kit Rainbow SDK for Node.JS!

The Alcatel-Lucent Enterprise (ALE) Starter-Kit Rainbow SDK for Node.JS is a basic sample for starting your development using the SDK for Node.JS in an easy way and within an advanced environment.

Preamble

You need a Node.JS LTS release installed on your computer.

You need a Rainbow account. Connect to the Rainbow HUB to get your developer account.

Installation

Clone this repository in the directory you want and then open a shell and executes the following command


$ npm install

Content

This Starter-Kit is a Node.JS application that:

  • Starts the SDK for Node.JS, connects it to Rainbow and answers to incoming chat messages

  • Starts a web server for monitoring your application

Setup

In order to setup your application, you have to configure 2 JSON files:

  • app/config/bot.json: This file contains your SDK for Node.JS parameter. Modify it with your Rainbow account.

  • app/config/router.json: This file contains the default parameter for the embedded web server. Modify it according to your need.

Once you have configured these two files, you can start the application by launching the following command:


$ node index.js

Server API

Your Node.JS contains an embedded server with 3 default routes:

  • GET .../botsample/ping: API for having an health check of your application

  • POST .../botsample/sdk/restart: API for restarting the SDK for Node.JS (stop and start).

  • GET .../botsample/sdk/status: API for having a status of the SDK for Node.JS

You can test these routes using CURL. Here is an example of testing the botsample/ping route when the Web Server is launched using HTTP and port 3002:


$ curl -X GET http://localhost:3002/botsample/ping
> {"code":0}

Note: When testing in HTTPS, default self-signed certificates are proposed. For testing with CURL, you have to add the parameter -k to avoid the CURL's verification like as follows (launched with HTTPS and port 3003):

$ curl -X GET https://localhost:3003/botsample/ping -k
> {"code":0}

Environment

ESLint

Basic rules for Node.JS JavaScript development have been added.

Unit Tests

Tests have to be added in directory test.

to launch the test, open a sheel and execute the following command:


$ npm test

Each time a file is modified, the tests are executed.

If you want to check the code coverage, launch the following command:


$ npm run coverage

Modules

New modules can be added to your application in directory app.

Docker container usage

Thanks to Dockerfile available a root directory, you are able to run the current Starter Kit into Docker.

After Docker installation ( See Docker ), run the following commandto build your own image.

docker build -t rainbow-api-hub/startkit-sdk-nodejs .

3 environment variables are required to run a container instance with the previous builded image:

  • RAINBOW_BOT_LOGIN (mandatory): User email associated to your bot.

  • RAINBOW_BOT_PASSWORD (mandatory): User password associated to your bot.

  • RAINBOW_HOST (optional, default value: sandbox.openrainbow.com ): Target host where your want to run your bot.

Use the following command in order to start you container instance, with the port 8888 as REST api entry point port

docker run -p 8888:8080 -e RAINBOW_BOT_LOGIN=<BOT_EMAIL> -e RAINBOW_BOT_PASSWORD=<BOT_PWD> -t rainbow-api-hub/startkit-sdk-nodejs