Answer the question
In order to leave comments, you need to log in
How to migrate a project to nuxt?
There is a working project on vue.js. After auditing the SEOs, you need to organize ssr.
I studied the issue for half a day, everywhere it is written in pieces. I would like to make sure that I understand the picture correctly:
- The essence of SSR is that my first request to the server will return me not an empty html file as it is now (application on vue-cli), but immediately filled. Otherwise, there is no difference.
- This same rendering is done using nodejs, that is, instead of simply uploading the file to nginx, you have to configure request processing through node.
Further, I am confused by the differences between a regular vue application and a nuxt application, namely the changed directory structure and routing. It turns out that I need to transfer the entire project and change a little. Why isn't it possible to just add server rendering to my already existing project? In addition, the picture with Ajax is not completely clear. For example, when I load a page, I have an ajax request that fills the page with data. Firstly, it is not clear how the node will determine these requests, I have them, for example, through $.ajax(), and secondly, there are requests that take quite a long time (a couple of seconds) - these are statistics that are counted. Now a beautiful preloader is spinning at the place of its appearance, but how will it be after the transfer to nuxt? The page will be rendered these couple of seconds?
Help, please, to understand.
Answer the question
In order to leave comments, you need to log in
everywhere written in pieces
upstream myAppName {
server 127.0.0.1:3003;
}
server {
listen 80;
location / {
proxy_pass http://myAppName;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header User-Agent $http_user_agent;
proxy_cache_bypass $http_upgrade;
}
}
mounted() {
if (process.browser) {
this.fetchStats();
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question