Open
Description
In react-engine you set the view engine
via a global app.set
variable.
app.set('view engine', 'js')
My request is for another global view option
app.set('view ignore extname', true)
Here's why:
In react engine you pass the current page url to res.render
app.get("/", function(req, res){
return res.render(req.url, data)
})
When that url has a period it is picked up by a rendering engine the as an extname
. So for the url /hello?url=google.com
you get an error because it's looking for the module com
.
You can enable periods in react-engine simply by commenting out this line. I'm putting in a pull request to copy the whole View
with this line commented but it would be great if express supported it.
Is there a way to do this already?