From b68052b4757d52b33506e87cfc8b64e88a921cd3 Mon Sep 17 00:00:00 2001 From: PJ Date: Mon, 27 Jan 2020 13:12:49 +0100 Subject: [PATCH] Change route order --- packages/siaviewnode-server/src/main.ts | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/packages/siaviewnode-server/src/main.ts b/packages/siaviewnode-server/src/main.ts index 2f1df899..fafdc5bf 100644 --- a/packages/siaviewnode-server/src/main.ts +++ b/packages/siaviewnode-server/src/main.ts @@ -117,6 +117,17 @@ export class Server { }) ) + this.app.get( + "/stats", this.handleStatsGET.bind(this) + // TODO: redirect to protalstats + // proxy("http://localhost:9980/renter/portalstats", { + // proxyReqOptDecorator: (opts, _) => { + // opts.headers["User-Agent"] = "Sia-Agent" + // return opts + // }, + // }) + ) + this.app.get( "/web/:hash", (req: Request, res: Response) => { const { hash } = req.params @@ -133,16 +144,6 @@ export class Server { } ) - this.app.get( - "/stats", this.handleStatsGET.bind(this) - // TODO: redirect to protalstats - // proxy("http://localhost:9980/renter/portalstats", { - // proxyReqOptDecorator: (opts, _) => { - // opts.headers["User-Agent"] = "Sia-Agent" - // return opts - // }, - // }) - ) } private async handleStatsGET(req: Request, res: Response): Promise {