Answer the question
In order to leave comments, you need to log in
How to push html-page into response(SPA)?
The point is this. I'm trying to write SPA. If I understood correctly, then there should be one HTML file that we will send for each url request. And depending on the url - process, hide\open and fill the elements of the HTML file. So: while using index.html as the start page as a static file ( app.use(express.static(__dirname ))
) everything worked fine. But when I decided to send it as a response to the start page
app.get('/', function(req, res, next){
res.sendfile('index.html')
})
HTML itself loaded, but neither the css file, nor jquery, and even the file with scripts did not want to connect. Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question