fix(core): App should not crash with a custom rest endpoint (#5911)

fixes #5880
This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2023-04-06 11:35:05 +02:00
committed by GitHub
parent 6689451e8c
commit 2881ee9ecc
6 changed files with 18 additions and 13 deletions

View File

@@ -144,6 +144,7 @@ export class Start extends BaseCommand {
private async generateStaticAssets() {
// Read the index file and replace the path placeholder
const n8nPath = config.getEnv('path');
const restEndpoint = config.getEnv('endpoints.rest');
const hooksUrls = config.getEnv('externalFrontendHooksUrls');
let scriptsString = '';
@@ -167,6 +168,7 @@ export class Start extends BaseCommand {
];
if (filePath.endsWith('index.html')) {
streams.push(
replaceStream('{{REST_ENDPOINT}}', restEndpoint, { ignoreCase: false }),
replaceStream(closingTitleTag, closingTitleTag + scriptsString, {
ignoreCase: false,
}),