I need to use websockets to send a view so it can be loaded within a tab. But I can’t seem to figure out how to load view into a variable for sending. Seems like the only way to load a view is to call the response.render() function.
Any ideas?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Most templating engines can render a template to an in-memory string, which you can then send over your web socket as raw data. Here’s the example from jade.
If you mention specifically which templating engine you are using, we can give specific examples if needed.
Here’s how to do it with EJS: