<commit_before><commit_msg>added a router for lights<commit_after>const Router = require('express').Router;
const checkAuthToken = require('./checkAuthToken');
const request = require('request-promise');

const lightsRouter = Router(); // eslint-disable-line new-cap

lightsRouter.get('/', checkAuthToken, (req, res) => {
    const hueUser = process.env.HUE_BRIDGE_USERNAME;
    const hueBridge = process.env.HUE_BRIDGE_ADDRESS;

    request({
        method: 'GET',
        url: 'http://' + hueBridge + '/api/' + hueUser + '/lights'
    }).then(result => {
        res.json(JSON.parse(result));
    }).catch(err => {
        console.log(err);
        res.status(500).json(err);
    });
});

module.exports = lightsRouter;
{'fraction_non_alphanumeric': 0.16897506925207756, 'fraction_numerical': 0.004155124653739612, 'mean_word_length': 3.51875, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '697782', 'n_tokens_mistral': 234, 'n_tokens_neox': 224, 'n_words': 44}