|
@@ -6,6 +6,7 @@ module.exports = {
|
|
|
|
|
|
|
|
var express = require('express'),
|
|
var express = require('express'),
|
|
|
bodyParser = require('body-parser'),
|
|
bodyParser = require('body-parser'),
|
|
|
|
|
+ cors = require('cors'),
|
|
|
routes = require('./routes.js');
|
|
routes = require('./routes.js');
|
|
|
|
|
|
|
|
function init(hueConfig) {
|
|
function init(hueConfig) {
|
|
@@ -13,8 +14,10 @@ function init(hueConfig) {
|
|
|
|
|
|
|
|
app.use(express.static('frontend'));
|
|
app.use(express.static('frontend'));
|
|
|
app.use(bodyParser.json());
|
|
app.use(bodyParser.json());
|
|
|
|
|
+ app.use(cors());
|
|
|
|
|
|
|
|
app.get ('/api/config', routes.getConfig);
|
|
app.get ('/api/config', routes.getConfig);
|
|
|
|
|
+ app.get ('/api/fullState', routes.getFullState);
|
|
|
app.get ('/api/lights', routes.getLights);
|
|
app.get ('/api/lights', routes.getLights);
|
|
|
app.post('/api/lights/:id', routes.setLight);
|
|
app.post('/api/lights/:id', routes.setLight);
|
|
|
|
|
|