feat: allow customizing auth host

This commit is contained in:
Nour 2024-01-26 15:14:40 +00:00
commit 894f3c3d14
No known key found for this signature in database
GPG key ID: 9744560DE7DA09AE
2 changed files with 3 additions and 1 deletions

View file

@ -33,6 +33,7 @@ export interface IConfig {
}; };
admin: IAdminOpts; admin: IAdminOpts;
authPort?: number; authPort?: number;
authHost?: string;
database: string; database: string;
logs: string; logs: string;
keys: Record<string, any>; keys: Record<string, any>;
@ -49,6 +50,7 @@ const defaultConfig: IConfig = {
] ]
}, },
authPort: 3000, authPort: 3000,
authHost: 'localhost',
admin: { admin: {
npubs: [], npubs: [],
adminRelays: [ adminRelays: [

View file

@ -185,7 +185,7 @@ class Daemon {
} }
}); });
this.fastify.listen({ port: this.config.authPort }); this.fastify.listen({ port: this.config.authPort, host: this.config.authHost });
this.fastify.get('/requests/:id', authorizeRequestWebHandler); this.fastify.get('/requests/:id', authorizeRequestWebHandler);
this.fastify.post('/requests/:id', processRequestWebHandler); this.fastify.post('/requests/:id', processRequestWebHandler);