const Util = require('../lib/util');
const config = {
- port: Getenv.int('TOMATO_SAUCE_PORT', 9999),
- frequency: Getenv.int('TOMATO_SAUCE_FREQUENCY', 333),
- modulation: Getenv.int('TOMATO_SAUCE_MODULATION_SPEED', 5)
+ port: Getenv.int('TOMATO_SAUCE_PORT', 9999),
+ frequency: Getenv.int('TOMATO_SAUCE_FREQUENCY', 333),
+ modulation: Getenv.int('TOMATO_SAUCE_MODULATION_SPEED', 5)
};
const screenPath = Getenv('TOMATO_SAUCE_SCREEN_PATH', Path.join(__dirname, '../lib/screens'));
Util.loadFiles(screenPath).then((screens) => {
- config.screens = screens;
- return Util.loadFiles(rendererPath);
+ config.screens = screens;
+ return Util.loadFiles(rendererPath);
})
- .then((renderers) => {
+ .then((renderers) => {
- config.renderers = renderers;
- })
- .then(() => {
+ config.renderers = renderers;
+ })
+ .then(() => {
- const tomatoSauce = new TomatoSauce(config);
+ const tomatoSauce = new TomatoSauce(config);
- tomatoSauce.on('listening', (event) => {
+ tomatoSauce.on('listening', (event) => {
- const address = event.data.server.address();
- console.log(`Tomato Sauce listening on: ${address.address}:${address.port}`);
- });
+ const address = event.data.server.address();
+ console.log(`Tomato Sauce listening on: ${address.address}:${address.port}`);
+ });
- tomatoSauce.on('error', (error) => {
+ tomatoSauce.on('error', (error) => {
- console.error(error.stack || error.message || error);
- process.exit(1);
- });
+ console.error(error.stack || error.message || error);
+ process.exit(1);
+ });
- tomatoSauce.run();
- });
+ tomatoSauce.run();
+ });