-
Download and install lite-server, if necessary.
Ensure that lite-server runs properly and shows your web app in the browser.
We followed the
online instructions
and installed lite-server globally with npm install --global lite-server.
And since we installed everything in the Administrator account, lite-server was placed in this folder on our machine:
C:\Users\Administrator\AppData\Roaming\npm
-
Download and install AlwaysUp, if necessary.
-
Start AlwaysUp.
-
Select Application > Add to open the Add Application window:
-
On the General tab:
-
In the Application field, enter the full path to the script that starts the server, lite-server.cmd.
If you installed lite-server in the default (global) location, this is:
C:\Users\<USER-NAME>\AppData\Roaming\npm\lite-server.cmd
where <USER-NAME> is the name of the Windows account where you installed lite-server.
-
In the Start in directory field, enter the full path to the folder containing your web files.
This is "C:\WWW" on our system.
-
In the Start the application field, choose Automatically, but shortly after the computer boots.
With this setting, lite-server will start a couple of minutes after boot — once all the machine's critical services are
fully up and running.
-
And in the Name field, enter the name that you will call the application in AlwaysUp.
We suggest lite-server but you can specify another name if you like.
-
Click over to the Logon tab and enter the user name and password of the account where you installed and run lite-server.
Node should run in this account so that it can find the script you installed.
-
We're done configuring lite-server as a Windows Service so click the Save button to record your settings.
In a couple of seconds, an application called lite-server (or whatever you called it) will show up in the AlwaysUp window.
It is not yet running though and the state will be "Stopped":
-
To start lite-server from AlwaysUp, choose Application > Start "lite-server".
In a few seconds, the status will change to "Running" and lite-server will be working in the background:
At this point, please open your browser and confirm that your web page is being served. Everything should be fine, as it was
on our machine:
-
That's it! Next time your computer boots, lite-server will start up immediately, in the background, without anyone needing to log on.
Please restart your PC now and test that everything works as expected after Windows springs back to life.
And please feel free to edit lite-server in AlwaysUp and explore the many other settings that may be appropriate for your environment.
For example, capture the Node console output to a file, constrain the application to a specific CPU, and much more.