Skip to content

Feature request View global option ignore extname #2708

Open
@reggi

Description

@reggi

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?

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions