Deploy App Node.js on localhost(Production)

Asked

Viewed 1,162 times

6

I developed an application with Angular + Node.js.

The only detail is that there is no centralized server (Node.js), that is, each client will have its version of the server running on its network.

Because of this, I had to create ways to install the app in Node.js in an easy way on each client, I tested an alternative that did not have the expected return:

  • Install the App as a windows service

Where I made a . bat with commands for installation of dependencies, addition of ports in the firewall, installation of services, etc..

To do this I used the lib "Node-windows" : https://github.com/coreybutler/node-windows

However, most computers do not run the script. You need to run again, sometimes you accuse permission error, in other appears on the console that worked, but when checking the services. they are not there, anyway.. I did several tests, changes and did not solve.

On that note, I’d like to know:

  • What alternatives do I have to install the App on (Node.js) on local machines? (I’m talking about production, not testing or DEV).

  • Is there any transparent or simplified way("Generate an executable"?! Maybe)

  • I read in some places that IIS is used to host the application, someone has had experience in this sense, have some example of the operation?

  • Already tested with IIS. It’s not very good no, you have to install a thing to work. I think a good way to do what you want is to create a docker with everything you need and just run it on the client.

1 answer

5


If your application uses Node + Angular, one possibility is to generate an executable via Electron.

It already comes with built-in Node.js. However, you can use npm and npm packages generate installers containing all modules in use, with the advantage that the user does not need to install any specific browser (since the Electron engine is itself a version of Chrome).

  • Bacana @Onosendai, I had heard of the Electron, but I hadn’t thought about it (nor did I know what I could do). But how would the structure of the project play the two projects I have (Client and Server) within a new project Electron? If it’s not too much to ask, you could show a basic usage example?

  • @Geferson in several projects that I implemented, that was the choice - both the static content (client) and the back end were embedded in the same solution. An excellent example can be studied here: https://scotch.io/tutorials/creating-desktop-applications-with-angularjs-and-github-electron

Browser other questions tagged

You are not signed in. Login or sign up in order to post.