throw new RangeError('staticRoute parameter should not have trailing slash');
}
+ // /static/ serves /static/index.html
+ // define before /static/:file else :file would match ''
+ this.on(['GET'], `${opt.staticRoute}/`, this.handlerGetStaticFile.bind(this), 'index.html');
+
// /static/:file serves file
this.on(['GET'], `${opt.staticRoute}/:file`, opt.staticRouteFileName, this.handlerGetStaticFile.bind(this));
// /static forwards to /static/
this.on(['GET'], opt.staticRoute, this.handlerRedirect.bind(this), `${this.proxyPrefix}${opt.staticRoute}/`);
- // /static/ serves /static/index.html
- this.on(['GET'], `${opt.staticRoute}/`, this.handlerGetStaticFile.bind(this), 'index.html');
-
// /favicon.ico and /robots.txt serve from /static/
this.on(['GET'], '/favicon.ico', this.handlerGetStaticFile.bind(this), 'favicon.ico');
this.on(['GET'], '/robots.txt', this.handlerGetStaticFile.bind(this), 'robots.txt');