Skip to content

Setting up a local web server

To run a Waytale space on your computer, you will need to start a local web server. Pick one of the options below to continue in the respective section. For some options you can find more detailed explanations here).

  • graphical, using Tiny Web Server (Windows, Linux), from same author as Waytale
  • command line, using Python (Windows, Linux, MacOS), requires Python installed
  • command line, using NodeJS (Windows, Linux, MacOS), requires NodeJS installed
  • command line, using Static Web Server (Windows, Linux, MacOS), can be downloaded

Why do I need to run a web server?

If you want to view a HTML file with embedded, non-trivial JavaScript code, then just opening the HTML file in your browser will unfortunately not work. Modern browsers disallow running more complicated web applications that way for security reasons.

A local web server means is only be accessible from your computer, unlike e.g. the web servers your browser communicates with when accessing a public website. Running a local web server is a common thing to do in web development and doing so is usually not complicated.

Please note that a local web server in such a development setup often only supports access via HTTP, not HTTPS. In most cases this is okay and common practice. Technically speaking, when your network communication remains confined to within your machine (i.e. localhost), then not using HTTPS is acceptable. (In every other case, please make sure you are always using HTTPS.)

Start web server with Tiny Web Server (graphical)

Tiny Web Server is a local web server that is very small (in size and features) for serving files via HTTP. It was created by the author of Waytale to be easy to use for people who do not want to install unnecessarily big, compliated, or untrustworthy software, or who do not feel comfortable using the command line. It looks like this:

Screenshot of Tiny Web Server

Using Tiny Web Server is easy: Go to the project website, navigate to Releases, get your executable and start. Then pick the directory of files you want your web server to serve and click Start. Done.

Tiny Web Server is currently available for Windows and Linux.

Start web server with Python (command line)

If you have Python installed, you can start a web server in the following way:

python -m http.server -d <your-directory> <port-number>

For example, the following command serves the Waytale space in the directory ./waytale-space/ relative to the current directory. After running the command you can acess your space on http://127.0.0.1:8080/ in your browser.

python -m http.server -d ./waytale-space/ 8080

Start web server with NodeJS (command line)

If you have NodeJS and NPM installed, you can start a web server in the following way:

npx http-server -p <port-number> <your-directory>

For example, the following command serves the Waytale space in the directory ./waytale-space/ relative to the current directory. After running the command you can acess your space on http://127.0.0.1:8080/ in your browser.

npx http-server -p 8080 ./waytale-space/

Start web server with Static Web Server (command line)

Many third-party web servers exist that are easy to use. For example, Static Web Server consists of only one file that can be downloaded and installed quickly. Then you can start a web server in the following way:

./static-web-server -p <port-number> -d <your-directory>

For example, the following command serves the Waytale space in the directory ./waytale-space/ relative to the current directory. After running the command you can acess your space on http://127.0.0.1:8080/ in your browser.

./static-web-server -p 8080 -d ./waytale-space/