const Debug = require('debug')('iot-home:server:hue')

var HueServer = {}

function HueRoutes (server, middleware) {
  server.get('/hue/bridges', middleware.findBridge)
  server.get('/hue/lights', middleware.findAllLights)
  server.get('/hue/light/:light', middleware.getState)
  server.get('/hue/light/:light/on', middleware.on)
  server.get('/hue/light/:light/off', middleware.off)
  server.put('/hue/light/:light/set', middleware.setHue)
  server.get('/hue/users', middleware.getAllUsers)
  server.get('/hue/user/:username', middleware.getUser)
  server.post('/hue/user', middleware.newUser)
  server.del('/hue/user', middleware.deleteUser)
  server.get('/hue/config', middleware.displayConfiguration)
}

HueServer.init = (API, middleware) => {
  Debug('Initializing Hue API Routes')

  return new HueRoutes(API, middleware)
}

module.exports = HueServer

@@ -236,24 +236,25 @@
 ('/hue/light
+s
 /:light', mi
@@ -288,32 +288,33 @@
 .get('/hue/light
+s
 /:light/on', mid
@@ -341,32 +341,33 @@
 .get('/hue/light
+s
 /:light/off', mi
@@ -404,16 +404,17 @@
 ue/light
+s
 /:light/
@@ -512,16 +512,17 @@
 hue/user
+s
 /:userna
@@ -562,32 +562,33 @@
 .post('/hue/user
+s
 ', middleware.ne
@@ -617,16 +617,17 @@
 hue/user
+s
 ', middl

Make routes follow JSON API standards