Enduro icon indicating copy to clipboard operation
Enduro copied to clipboard

Rewriting routes

Open karneaud opened this issue 8 years ago • 2 comments

I have the following route in my app.js file

var local_app = function () {}, path = require('path')

local_app.prototype.init = function (app) {
  app.get("/costumespage/popup/(|male|female)/\d/", function(req, res) {
    res.sendFile(path.resolve(__dirname + '/../_generated/index.html'));
  });
}

module.exports = new local_app()

When I try to access the url http://192.168.99.100:5000/costumespage/popup/female/1/#costumespage I'm being given the error below

Error: ENOENT: no such file or directory, stat '/usr/src/app/_generated/costumespage/popup/female/1/index.html'

Does Enduro have rewrite rules in place?

karneaud avatar Aug 26 '17 18:08 karneaud

I note that at this line

You add the request url to the path. Is there anyway I can "override" this default for the specific URL?

karneaud avatar Aug 30 '17 11:08 karneaud

I'm working on building a "rerouter". The is my first run at a cold-coded attempt (read: "does not work yet"), but it should be complete in the next month ofr so. https://github.com/tekwiz/Enduro/tree/feature/rerouter.

tekwiz avatar Jan 24 '18 18:01 tekwiz