mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-24 20:24:05 -08:00
✨ Make it possible to disable the UI
This commit is contained in:
parent
1e42effc3a
commit
48f0f71f95
|
@ -507,6 +507,12 @@ const config = convict({
|
||||||
env: 'N8N_ENDPOINT_WEBHOOK_TEST',
|
env: 'N8N_ENDPOINT_WEBHOOK_TEST',
|
||||||
doc: 'Path for test-webhook endpoint',
|
doc: 'Path for test-webhook endpoint',
|
||||||
},
|
},
|
||||||
|
disableUi: {
|
||||||
|
format: Boolean,
|
||||||
|
default: false,
|
||||||
|
env: 'N8N_DISABLE_UI',
|
||||||
|
doc: 'Disable N8N UI (Frontend).',
|
||||||
|
},
|
||||||
disableProductionWebhooksOnMainProcess: {
|
disableProductionWebhooksOnMainProcess: {
|
||||||
format: Boolean,
|
format: Boolean,
|
||||||
default: false,
|
default: false,
|
||||||
|
|
|
@ -2884,6 +2884,7 @@ class App {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (config.get('endpoints.disableUi') !== true) {
|
||||||
// Read the index file and replace the path placeholder
|
// Read the index file and replace the path placeholder
|
||||||
const editorUiPath = require.resolve('n8n-editor-ui');
|
const editorUiPath = require.resolve('n8n-editor-ui');
|
||||||
const filePath = pathJoin(pathDirname(editorUiPath), 'dist', 'index.html');
|
const filePath = pathJoin(pathDirname(editorUiPath), 'dist', 'index.html');
|
||||||
|
@ -2899,7 +2900,6 @@ class App {
|
||||||
});
|
});
|
||||||
|
|
||||||
// Serve the website
|
// Serve the website
|
||||||
const startTime = new Date().toUTCString();
|
|
||||||
this.app.use(
|
this.app.use(
|
||||||
'/',
|
'/',
|
||||||
express.static(pathJoin(pathDirname(editorUiPath), 'dist'), {
|
express.static(pathJoin(pathDirname(editorUiPath), 'dist'), {
|
||||||
|
@ -2915,6 +2915,8 @@ class App {
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
const startTime = new Date().toUTCString();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function start(): Promise<void> {
|
export async function start(): Promise<void> {
|
||||||
|
|
Loading…
Reference in a new issue