Skip to content

Latest commit

 

History

History
30 lines (19 loc) · 2.02 KB

File metadata and controls

30 lines (19 loc) · 2.02 KB

Basic Server

Since we will be loading in data files, we need to use a basic server to serve our local files to the browser. To do this, follow the steps below. If you are interested, you can read more about why this is the case here, here, and here.

Before you start, you will need to install serve, which is a library for written for running a simple NodeJS server. Luckily, since we already have Node installed, we also have access to NPM, or Node Package Manager, which we can use to install serve and all of its dependencies. To do that, running the following from your terminal/commamd line:

# goes through and installs the library and all of its dependencies
$ npm install -g serve

Once your installations are complete and you're ready to begin working on your tutorial assignment, use your terminal (or git bash, on PC) to navigate to the root directory of your fork. Your path may look different, but the command will be something like this:

$ cd Documents/My\ Repositories/Interactive-Data-Vis-Sp2020/

From this level, (not from the tutorial folder), run:

$ serve

This will start a simple web server that will serve the course files. After you run this line you should see something like the following:

Your files will now be available if you go to the following address in your browser http://localhost:5000.

When you open http://localhost:5000/, you should see your repository's folder structure. Click into that week's tutorial. The file showing is your index.html file. If you want to view the class demo file, you can change your URL path. For example: http://localhost:5000/TUTORIAL_PATH/demo.