aboutsummaryrefslogtreecommitdiff
path: root/src/index.ts
diff options
context:
space:
mode:
authorElizabeth Hunt <me@liz.coffee>2025-12-15 00:58:43 -0800
committerElizabeth Hunt <me@liz.coffee>2025-12-15 00:58:43 -0800
commit2e41f030f02a336c2e9866d3d56b0494da5a622e (patch)
tree226d7fe0f2e0d5af847c31d97c1ab9664d1b7e33 /src/index.ts
parent9c9f35734e795e3c2cea21384349b655d7ffa164 (diff)
downloadposthook-2e41f030f02a336c2e9866d3d56b0494da5a622e.tar.gz
posthook-2e41f030f02a336c2e9866d3d56b0494da5a622e.zip
Remove admin route in favor of a simpler toml format
Diffstat (limited to 'src/index.ts')
-rw-r--r--src/index.ts6
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()) {