Friday, 20 July 2018

Node.js : How to embed Node.js into HTML?

In a php file I can do:

<p><?php echo "hello!";?></p>

Is there a way to do this in node, if yes what's the logic for it?

I have an idea how could this be done:

  • Use an identifier markup for node in the HTML file like: <node>code</node>

  • Load & Parse HTML file in Node

  • Grab node markup from the HTML file and run it

But I'm not sure if this is the best way or even if it works :)

Please note I want to learn node.js, so express and other libraries and modules are not answers for me, because I want to know the logic of the process.



from Node.js : How to embed Node.js into HTML?

No comments:

Post a Comment