diff options
Diffstat (limited to 'src/index.ts')
| -rw-r--r-- | src/index.ts | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/index.ts b/src/index.ts index 0ece985..2985d36 100644 --- a/src/index.ts +++ b/src/index.ts @@ -7,11 +7,12 @@ import { TokenSigner } from './token/index.js'; const main = async (_argv = process.argv.slice(2)): Promise<IEither<Error, void>> => { const argsResult = argv( - ['--port', '--host', '--data-dir', '--token-secret', '--cors-origins'], + ['--port', '--host', '--data-dir', '--config', '--token-secret', '--cors-origins'], { '--port': { absent: 9000, present: (port) => parseInt(port) }, '--host': { absent: '0.0.0.0', present: (host) => host }, '--data-dir': { absent: './data', present: (dir) => dir }, + '--config': { absent: './routes.toml', present: (path) => path }, '--token-secret': { absent: undefined, present: (secret) => secret }, '--cors-origins': { absent: '*', present: (origins) => origins }, }, @@ -23,12 +24,13 @@ const main = async (_argv = process.argv.slice(2)): Promise<IEither<Error, void> port: args['--port'], host: args['--host'], dataDir: args['--data-dir'], + configPath: args['--config'], tokenSecret: args['--token-secret'], corsOrigins: args['--cors-origins'], })) .flatMapAsync(async (config) => { // Initialize storage - const storage = new Storage(config.dataDir); + const storage = new Storage(config.dataDir, config.configPath); const initResult = await storage.init(); if (initResult.left().present()) { |
