mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Fixes #19 - httpRoot and httpAuth not taking effect
We were attaching the editor app rather than the main app to the server, which meant the root and auth routes were ignored.
This commit is contained in:
10
red/ui.js
10
red/ui.js
@@ -21,8 +21,14 @@ var app = express();
|
||||
|
||||
function setupUI(settings) {
|
||||
|
||||
app.get(/^$/,function(req,res) {
|
||||
res.redirect("/");
|
||||
// Need to ensure the url ends with a '/' so the static serving works
|
||||
// with relative paths
|
||||
app.get("/",function(req,res) {
|
||||
if (req.originalUrl.slice(-1) != "/") {
|
||||
res.redirect(req.originalUrl+"/");
|
||||
} else {
|
||||
req.next();
|
||||
}
|
||||
});
|
||||
|
||||
app.use("/",express.static(__dirname + '/../public'));
|
||||
|
Reference in New Issue
Block a user