Last active
April 25, 2019 12:51
-
-
Save SubhashiniSundaresan/13d52d6774465c3b7790fe6cd5fb5775 to your computer and use it in GitHub Desktop.
Revisions
-
SubhashiniSundaresan revised this gist
Apr 25, 2019 . 1 changed file with 20 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,20 @@ npm install -s express npm install -s morgan chalk npm install nodemon -g const light = require('tp-link-api-cloud'); //Requires const express = require('express'); const app = express(); const path = require('path'); const chalk = require('chalk'); const morgan = require('morgan'); //Static Routes app.use('/dist', express.static(path.join(__dirname, 'dist'))); app.use(morgan('dev')) // logging //Main App Route app.get('/', (req, res, next) => res.sendFile(path.join(__dirname, 'dist/index.html'))); app.get('/start', (req, res, next) => {light.lightbulb(req.params.brightness)} const port = 1337; //Run Server app.listen(process.env.PORT || port, () => console.log(chalk.blue(`Listening intently on port ${port}`))); -
SubhashiniSundaresan created this gist
Mar 27, 2019 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,19 @@ npm install -s express npm install -s morgan chalk npm install nodemon -g //Requires const express = require('express'); const app = express(); const path = require('path'); const chalk = require('chalk'); const morgan = require('morgan'); //Static Routes app.use('/dist', express.static(path.join(__dirname, 'dist'))); app.use(morgan('dev')) // logging //Main App Route app.get('/', (req, res, next) => res.sendFile(path.join(__dirname, 'dist/index.html'))); const port = 1337; //Run Server app.listen(process.env.PORT || port, () => console.log(chalk.blue(`Listening intently on port ${port}`)));