Deploy NodeJs Express App on Windows and Linux Server - node.js

I am developing a small project which contains few applications:
A node.js rest API
A node.js app that use socket.io.
A static app that server html js file to the client.
I am also using a MongoDb.
In few weeks, I'll have to deploy this app in production and I have some requirements that the app should be installed on windows and Linux server (Don't really know if it really matters).
I had a look at some tooling :
StrongLoop Process Manager
PM2
Forever
But cannot really find out if these tools are up to date or if there are better alternative in 2016 ?

Here are what seem to be the recommended ways that I've found:
Windows: iis-node (and this vid is helpful to get that going). Also note you'll need IIS 8x to support websockets.
Linux: PM2 to manage the process, and nginx for proxy server. This article has helpful step-by-step for Ubuntu.

Related

Looking for a way to pack node app into standalone Windows executable running as Windows service

I need to run a node.js server application as a self-contained executable which should be a Windows service. There are several libraries creating either a self-contained executable or which implement a Windows service layer in node.js but do not create a self-contained executable which is a Windows service itself.
Requirements are:
node.js server app should be deployed as Windows service (self-contained, win-exe, no node installation on target machine)
Windows service should be able to use parameters for node.js server app (e.g. a TCP port number or node_env)
it would be great, if some files could be stored beside the service which are used within node.js server app (e.g. SSL certificates)
Does anyone know an open source tool, library or sth. else which does fulfill these requirements and which is maintained well (still supported / developed, no critical old open issues etc.)?

Create Node Js Executable App for Mac

I have a MEAN stack application running on my local laptop. I want to make an executable out of it which I can give to my other teammates so that they can install it on their laptop. My teammates will have mongoDB installed since my app is using mongodb. How can I create such an app. It would be great if while installing the app, it also installs node, express npm on one's laptop.
Please help!
Thanks!
One way to do it would be to use Electron. You don't need to use BrowserWindow if you don't need a GUI but Electron gives you nice tools to package and install your app on Mac, Windows and Linux.
Using Electron you could even make the frontend side of your app appear inside of a native window so that no web browser would be needed to access your application.
See:
http://electron.atom.io/docs/tutorial/application-distribution/
Other options:
https://jaredallard.me/nexe/
http://enclosejs.com/

node.js self-hosting on windows without iisnode

Sorry for if it's a duplicate but i couldn't find it.
I have an .net mvc app on windows server 2012 R2 with IIS 8.5. I will use some socket operations in my app. So i write an app in node.js with socket.io.
I want to host my node app in same server. All articles that i've found says "use iisnode". But I am not sure about that because of possible issues. Specially performance issues make me suspicious.
My questions are:
Should i trust iisnode to serve node app on windows?
or
What are any other options to host node.js app on windows without iisnode?
I've already read
Installing and Running node.js applications within IIS on Windows - Are you mad?, https://tomasz.janczuk.org/2011/08/hosting-nodejs-applications-in-iis-on.html and https://tomasz.janczuk.org/2013/01/hosting-socketio-websocket-apps-in-iis.html blog posts.

how to start stop worklight server 6.2 on linux?

I have Worklight Server and Appcenter installed on RHEL 6.4 and am unable to find commands to start & stop these servers gracefully. Primarily, I would like to do this to apply patches, make changes to databases etc.. Any help is really appreciated.
It sounds to me like you are referring to installed instances of Worklight Server and Application Center in a QA/UAT/Production environment.
This means that your Worklight Server and Application Center instances are deployed to some application server (either WAS, WAS Liberty or Tomcat). So the way to start and stop these instances would be via the commands available by the the used application server. You should probably then consult with the user documentation of the used application server for the commands. For example for Liberty: http://www-01.ibm.com/support/knowledgecenter/was_beta_liberty/com.ibm.websphere.wlp.nd.multiplatform.doc/ae/twlp_admin_script.html
If you are in fact referring to the Worklight Development Server (Worklight Studio plug-in for Eclipse), there is no publically available way to stop the server from command line -- unless you are using the CLI tool to manage your development (working outside of Eclipse), there you do have a command for it.

Windows Phone with node.js / socket-io. How to start?

I have some socket-io server on node.js running.
I want to communicate from Windows Phone application to this node.js.
But I have no idea how to start with this.
I've found SocketIO4NET and it's running fantastic but on console application. I can not move it to Windows Phone unfortenately because there is no WP version of SocketIO4NET assembly.
Does anybody have any idea how to bite it?
One approach to this could be as follows.
Create a phonegap app for the Windows Phone, with socket.io.js included in the app (so that it can send events to the node server). And obviously create a NodeJs server, with socket.io module, which will listen and respond to the events sent from the phonegap app.
This approach could be useful, if you really don't want to stick to a native Windows Phone app.
Refer to this video to get a clue. http://www.youtube.com/watch?v=M5IAlnU96SI

Resources