From b83b8dd5aef03084133c5983de6f312e7d1654b8 Mon Sep 17 00:00:00 2001 From: Rigel Kent Date: Wed, 14 Nov 2018 15:27:47 +0100 Subject: add cli option to run without client --- server.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'server.ts') diff --git a/server.ts b/server.ts index 59fb820b4..51aa67638 100644 --- a/server.ts +++ b/server.ts @@ -16,6 +16,7 @@ import * as cookieParser from 'cookie-parser' import * as helmet from 'helmet' import * as useragent from 'useragent' import * as anonymize from 'ip-anonymize' +import * as cli from 'commander' process.title = 'peertube' @@ -98,6 +99,10 @@ import { VideosRedundancyScheduler } from './server/lib/schedulers/videos-redund // ----------- Command line ----------- +cli + .option('--no-client', 'Start PeerTube without client interface') + .parse(process.argv) + // ----------- App ----------- // Enable CORS for develop @@ -151,7 +156,7 @@ app.use('/', trackerRouter) app.use('/', staticRouter) // Client files, last valid routes! -app.use('/', clientsRouter) +if (cli.client) app.use('/', clientsRouter) // ----------- Errors ----------- -- cgit v1.2.3