Tell me, so doing, if Express.js gives the front at the Vue data in JSON over http directly on a different port?

Hello.

Continue to deal with how should I organize the interaction of the front Nuxt to him on one of the Node frameworks (e.g. Express, Koa, etc.)

Yet nothing unclear and clear the docks, not found everywhere write about dev and nothing really about the production :(

Is it possible to do so (Ubuntu on VPS):

1. Start net Express, say, 9900 port.

2. Nuxt to run on port 80 (yet did not understand, do I need to front apache or nginx)

3. Taking the data in front using axios turning on port 9900.

Do that?

Or as it is usually done?

Thank you.
March 23rd 20 at 19:09
2 answers
March 23rd 20 at 19:11
Solution
It can be done, but you need to care about the protection of 9900 port on the machine, to fiction free access to this port
How else? Requests-the client will go. It means free access. Although the idea can be a csrf token to use... or what do you suggest?)) - luciano_Auer29 commented on March 23rd 20 at 19:14
@luciano_Auer29at least cors. And from then on Holodnaya, Tokina authorization, create loops - nathanial commented on March 23rd 20 at 19:17
@luciano_Auer29, Or not be into hard, and nginx will configure the host using passenger processing node, But the essence remains the same, the access node remains open to the world, so protection is still needed - nathanial commented on March 23rd 20 at 19:20
March 23rd 20 at 19:13
I don't know about nuxt, but that's what usually do the ui/api.

Find more questions by tags Vue.jsNode.js