New config entries
This commit is contained in:
parent
47e4db1fc8
commit
553efb1da6
@ -2,3 +2,5 @@ HOST=127.0.0.1 # 0.0.0.0 if txtdot is not behind reverse proxy
|
|||||||
PORT=8080
|
PORT=8080
|
||||||
|
|
||||||
REVERSE_PROXY=true # only for reverse proxy; see docs
|
REVERSE_PROXY=true # only for reverse proxy; see docs
|
||||||
|
|
||||||
|
PROXY_RES=true
|
||||||
|
@ -55,7 +55,10 @@ class App {
|
|||||||
|
|
||||||
fastify.register(indexRoute);
|
fastify.register(indexRoute);
|
||||||
fastify.register(getRoute);
|
fastify.register(getRoute);
|
||||||
fastify.register(proxyRoute);
|
|
||||||
|
if (this.config.proxy_res)
|
||||||
|
fastify.register(proxyRoute);
|
||||||
|
|
||||||
fastify.register(parseRoute);
|
fastify.register(parseRoute);
|
||||||
fastify.register(rawHtml);
|
fastify.register(rawHtml);
|
||||||
|
|
||||||
|
@ -4,6 +4,7 @@ export class ConfigService {
|
|||||||
public readonly host: string;
|
public readonly host: string;
|
||||||
public readonly port: number;
|
public readonly port: number;
|
||||||
public readonly reverse_proxy: boolean;
|
public readonly reverse_proxy: boolean;
|
||||||
|
public readonly proxy_res: boolean;
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
config();
|
config();
|
||||||
@ -12,5 +13,7 @@ export class ConfigService {
|
|||||||
this.port = Number(process.env.PORT) || 8080;
|
this.port = Number(process.env.PORT) || 8080;
|
||||||
|
|
||||||
this.reverse_proxy = Boolean(process.env.REVERSE_PROXY) || false;
|
this.reverse_proxy = Boolean(process.env.REVERSE_PROXY) || false;
|
||||||
|
|
||||||
|
this.proxy_res = Boolean(process.env.PROXY_RES) || true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user