mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Add dedicated route for editor index.html
This commit is contained in:
parent
e1dd8cf2ab
commit
e1f0969957
@ -42,9 +42,9 @@ function init(adminApp,storage) {
|
||||
// Editor
|
||||
if (!settings.disableEditor) {
|
||||
var editorApp = express();
|
||||
editorApp.get("/",ui.ensureSlash);
|
||||
editorApp.get("/",ui.ensureSlash,ui.editor);
|
||||
editorApp.get("/icons/:icon",ui.icon);
|
||||
editorApp.use("/",ui.editor);
|
||||
editorApp.use("/",ui.editorResources);
|
||||
adminApp.use(editorApp);
|
||||
}
|
||||
|
||||
|
@ -55,5 +55,8 @@ module.exports = {
|
||||
res.sendfile(defaultIcon);
|
||||
}
|
||||
},
|
||||
editor: express.static(__dirname + '/../../public')
|
||||
editor: function(req,res) {
|
||||
res.sendfile(path.resolve(__dirname + '/../../public/index.html'));
|
||||
},
|
||||
editorResources: express.static(__dirname + '/../../public')
|
||||
};
|
||||
|
@ -152,8 +152,24 @@ describe("ui api", function() {
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
describe("editor ui resource handler", function() {
|
||||
before(function() {
|
||||
app = express();
|
||||
app.use("/",ui.editorResources);
|
||||
});
|
||||
it('serves the editor resources', function(done) {
|
||||
request(app)
|
||||
.get("/favicon.ico")
|
||||
.expect(200)
|
||||
.end(function(err,res) {
|
||||
if (err) {
|
||||
return done(err);
|
||||
}
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user