-
-
Notifications
You must be signed in to change notification settings - Fork 17.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request View global option ignore extname #2708
Comments
Hi @reggi ! I'm not sure what feature you are requesting. Can you add more details/specificity? |
Sorry @dougwilson I pressed enter too quickly and it posted with no content, updated! |
Unfortunately view names are specifically file system based names. This means you cannot pass in URLs. At best, you can always do |
Actually, something we could do is provide something better than a "default" engine, or even expand the default engine in Express 5.0 to include files that have an extension but no mapping. |
@dougwilson in the case of react-engine it allows (encourages you) you to pass in Here's a log from Visiting route with
Visiting route with
|
Yes, they can recommend stuff all they want, but it doesn't change the fact that our current views only work with file system names. Frankly, their documentation is wrong/incomplete. You need to use |
@dougwilson The example above is the url |
I've already provided the solution we will implement at #2708 (comment) which would work for the use-case you presented here. |
Thanks a bunch @dougwilson! Excited to see this feature in Express 5. |
👍 |
@reggi if there's no route defined for @dougwilson I am taking a look at this. Can you explain "include files that have an extension but no mapping" with an example? |
@dougwilson I'd also be interested in actually implementing this but as it stands it's not clear what is actually requested as @hacksparrow explained. |
In react-engine you set the
view engine
via a globalapp.set
variable.My request is for another global view option
Here's why:
In react engine you pass the current page url to
res.render
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 modulecom
.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?
The text was updated successfully, but these errors were encountered: