You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While certainly not a permanent fix, I managed to work around this with the following code after creating the router.
// Register new 405 handlerrouter.__405=router._405;router._405=function(req,res,route){varfiles=config.http.default_home.map(function(filename){returnpath.join(route,filename);}).filter(function(shortname){try{varstat=fs.statSync(path.join(config.http.static_route,shortname));returnstat.isFile();}catch(e){returnfalse;}});if(files.length){returnrouter.static(files.shift(),req,res);}returnrouter.__405(req,res,route);};
Keep in mind that I've fetched the config.http array from my own config structure. You will need to supply your own configuration to make this work within your project.
Currently this option is only available on the 'home' path, it would be quite useful to have this in subdirectories, too.
The text was updated successfully, but these errors were encountered: