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

Get rendered file at runtime #581

Closed
ghost opened this issue Feb 11, 2021 · 1 comment
Closed

Get rendered file at runtime #581

ghost opened this issue Feb 11, 2021 · 1 comment

Comments

@ghost
Copy link

ghost commented Feb 11, 2021

Hello,

I am working on a website where I want to separate dynamic server side content from static client side responses. for curious ones, I want to expose a front end version to contributors (on style mainly) to work on freely. but at the same time, I want to keep my server side repository private for few collaborators.

I can simply run a request and then manually copy rendered content to the other public repository. However as the web app evolves, I want to make a function in Nodejs that could hopefully export a render for some requests into HTML along with dependencies (JS/ CSS/ PNGs).

To put it simple, this code here is a response to a request,

app.get('/', function (req, res) {
  res.render('index')
})

And other requests. All I want is to catch res.render and export it to a file somehow.

@ghost
Copy link
Author

ghost commented Feb 11, 2021

Sorry, my bad, there is ejs.render just for this.

@ghost ghost closed this as completed Feb 11, 2021
This issue was closed.
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

0 participants