1.0.1 • Published 6 years ago
southern_lights_server v1.0.1
About
An API server for managing data for lights and groups and sending to subscribers.
Install
NPM
npm install southern_lights_server
Manual
var server = require('./server.js');
Use
To use, setup the server.
Provide an options object with a port for the api.
The 'socket_server_url' is the address for the webhook to the socket broadcaster to broadcast to the client.
var server = require('southern_lights_server');
server.createServer({port: 80, socket_url: 'socket_server_url' });
SSL
Create a standard ssl option object and load your key and crt file, ca file is optional.
Pass the sslOptions object as the ssl property for the server options.
var server = require('southern_lights_server');
var fs = require('fs');
var sslOptions = {
key: fs.readFileSync('path/to/key/file.key','utf8'),
crt: fs.readFileSync('path/to/crt/file.crt','utf8')
};
server.createServer({port: 80, socket_url: 'socket_server_url', ssl: sslOptions });
API Server
Get the current running instance of the API Server.
var server = require('southern_lights_server');
var apiServer = server.getServer();
1.0.1
6 years ago