B
B
beduin012017-02-27 13:49:12
Node.js
beduin01, 2017-02-27 13:49:12

Is it possible to run a site written in NodeJS without NodeJS?

NodeJS started using less than a month ago. I use Vue.JS as a web framework. There is a strong desire to use Node JS only for development, and host the application on another server (not on NodeJS).
However, as I understand it, this is not possible. For example, in Vue, part of the logic is taken out in .vue files and NodeJS itself loads them somehow as templates. Do I understand correctly that the main problem is that NodeJS implements support for the export directive, without which such loading cannot be implemented, or are there any other points?
Is it possible to emulate this directive so that I can run the specified code on IIS for example?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
amokrushin, 2017-02-27
@beduin01

Node.js does not load any *.vue files (get a syntax error when trying to include a .vue file), this is done either by webpack with the vue-loader plugin or browserify with the vueify plugin , which in turn are tools for building client code into a package ( bundle) - a separate file in which the code with all dependencies is assembled.
These tools need Node.js to work, but what they produce as an output is no longer connected with node.js - there will be no require / export in this code. Just copy these files from the build directory, connect to the page with the script tag, link and host anything, nginx, IIS. Of course, we are talking only about the client part of the application.
Vue.js is tied to a node in only one place -Server-Side Rendering , but this applies to the server side of the application.

V
Vitaly, 2017-02-27
@vshvydky

I just don’t understand, so I’m making a react frontend, writing in js jsx, then I assemble it into a project with tools, these tools are interpreted through node.exe, then I upload the finished build to the server and distribute it through nginx or Apache, that’s it. But if I use coa, express or socket io for example, I run them as a service in the node and that's it. I think it all depends on the task.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question