Publishing

Once your application or website is ready for your users, you will need to upload the final content to a hosting service to make it accessible.

Static Websites

If you are creating a static website, we recommend building the entire website before finally publishing it.

This process is very simple and will make your website extremely fast for all users. Furthermore, you will not need to include any additional programs in the hosting service nor will you have to worry about the execution of processes on the server.

There are many hosting services that allow you to publish static websites at no cost. For example, you can publish directly to GitHub Pages totally free.

Building Websites

Once your project is ready to be published run the following command into the project folder:

build.bat
./build.sh

If your website has absolute routes to navigate or retrieve web assets and you want to publish the static website into a especific URL path you can use this syntax:

build.bat path/prefix
./build.sh path/prefix

Then the building system will update all absolute routes to path/prefix and your website will be accesible from https://acme.com/path/prefix/ when publishing in the hosting server.

Dynamic Web Apps

If you are creating a dynamic web application, the build system will not be very useful.

In this case you will have to consider hiring a hosting service that meets the requirements to run Previous.js and you will have to monitor the server processes to keep the service active at all times.

To run your application on a production server you can use a command like this:

start.bat 8085 > log.txt
./start.sh 8085 > log.txt &

In this example we are running the server in the port 8085, but probabily you will need to open the port to public in the server or use port fordwarding with Apache or Nginx to get access from the default ports 80 or 443.

Also, it must be considered that the generated log file can grow too large, so it is recommended to use other logging strategies with which to maintain an active production server.

Remember!

Previous.js is a meme, it was not created to publish real content to a production server unless you know very well what you are doing and know the security implications necessary to safeguard your application data and guarantee the web service to your clients.