🐛 Fix naming of events in AffinityTrigger Node

This commit is contained in:
Jan Oberhauser
2020-07-12 09:28:08 +02:00
parent c08ff6cee3
commit bcabdc457b
8 changed files with 33 additions and 9 deletions

View File

@@ -204,6 +204,13 @@ const config = convict({
},
// How n8n can be reached (Editor & REST-API)
path: {
format: String,
default: '/',
arg: 'path',
env: 'N8N_PATH',
doc: 'Path n8n is deployed to'
},
host: {
format: String,
default: 'localhost',

View File

@@ -1693,9 +1693,21 @@ class App {
});
}
// Read the index file and replace the path placeholder
const editorUiPath = require.resolve('n8n-editor-ui');
const filePath = pathJoin(pathDirname(editorUiPath), 'dist', 'index.html');
let readIndexFile = readFileSync(filePath, 'utf8');
const n8nPath = config.get('path');
readIndexFile = readIndexFile.replace(/\/%BASE_PATH%\//g, n8nPath);
// Serve the altered index.html file separately
this.app.get(`/index.html`, async (req: express.Request, res: express.Response) => {
res.send(readIndexFile);
});
// Serve the website
const startTime = (new Date()).toUTCString();
const editorUiPath = require.resolve('n8n-editor-ui');
this.app.use('/', express.static(pathJoin(pathDirname(editorUiPath), 'dist'), {
index: 'index.html',
setHeaders: (res, path) => {