Having tied myself up in knots trying to expand my static pages to be more 'dynamic', I am now thinking that it's time to try some server side templating (no experience in this area). I would like to migrate across slowly rather than make large changes in one go.
If I am using nodejs, express and a template engine (e.g. ejs), can I use my existing html (which runs JS to get data from a parse-server and display) as the starting point? So, as a simple example, using my existing HTML as is, can I pass in a variable before serving the page? Then let the client side JS run as it did previously but now use the earlier passed variable?
Would I need to deconstruct the HTML into something that is compatible with a given template engine (e.g. change how the JS and CSS files are referenced)?
The info I find online shows creating the template from scratch rather than using an existing HTML file; so not clear if this is possible.