R
R
righty_dev2021-03-25 12:24:13
JavaScript
righty_dev, 2021-03-25 12:24:13

How to run html pages in localhost via npm start?

I have a few rendered pages, and I want the npm start command to output the pages to localhost:8080. It is also necessary that all pages are rendered in js through window.renderTemplate, and the pages should be displayed in accordance with the alias. How can this task be completed? Perhaps the question is stupid, but I did not find a specific answer for
an example of rendering:

window.renderTemplate = function(alias, data) {
   // ...
   return '<HTML-разметка отдельного слайда в виде строки>';
}

alias is the url (path) of the file, data is the data with json

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question