mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-20 12:55:26 +02:00
Attempting to make it easier to work with a single device. Still not bound to the new controlService.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
var url = require('url')
|
||||
var http = require('http')
|
||||
var events = require('events')
|
||||
var path = require('path')
|
||||
|
||||
var express = require('express')
|
||||
var validator = require('express-validator')
|
||||
@@ -73,13 +74,14 @@ module.exports = function(options) {
|
||||
groupRouter.emit(channel.toString(), channel, data)
|
||||
})
|
||||
|
||||
app.get('/partials/:name', function(req, res) {
|
||||
app.get('/partials/*', function(req, res) {
|
||||
var whitelist = {
|
||||
'deviceList': true
|
||||
'devices/index': true
|
||||
, 'devices/control': true
|
||||
}
|
||||
|
||||
if (whitelist[req.params.name]) {
|
||||
res.render('partials/' + req.params.name)
|
||||
if (whitelist.hasOwnProperty(req.params[0])) {
|
||||
res.render(path.join('partials', req.params[0]))
|
||||
}
|
||||
else {
|
||||
res.send(404)
|
||||
|
||||
Reference in New Issue
Block a user