Skip to content
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

Res.Render documentation missing information. #1457

Open
arch-linux opened this issue Jan 29, 2024 · 1 comment
Open

Res.Render documentation missing information. #1457

arch-linux opened this issue Jan 29, 2024 · 1 comment

Comments

@arch-linux
Copy link

I cannot find any information anywhere in the documentation or of other sources where res.render pulls the HTML from that we are referencing in the documentation.

For example, I want to render some HTML (preferably in a file somewhere) and inject some variables into it. In the photo below at docs we are stating 'email'.

image

  • Does this mean email.html in the same directory as this .js script?
  • Does this mean we previously read the file email.html and read it into memory somewhere?

I have been trying to understand this process of express and utilize this function but everyone just glances over this part in particular.

So. where is the html for email?

@dougwilson dougwilson transferred this issue from expressjs/express Jan 29, 2024
@krzysdz
Copy link

krzysdz commented Jan 29, 2024

It uses the configured view engine ('view engine' option) to render templates from the directory specified in 'views' (process.cwd() + '/views' by default).

You can read more about template engines e.g. in the Using template engines with Express guide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants