Exercise 14 Setting Up the Web Directory
Data None
Overall Goal To properly configure a desktop to host web applications locally
Demonstrates How to use Python to properly set up a local server

When testing web pages, we need to create a simple local HTTP server to access its functionality. This simple server will be closed once the computer is shut down. These are the specific instructions if you are using a training computer. The http server is a command in Python 3.x. Additionally, you may wish to navigate to a different directory based on where your training data is stored.

Optional Step

If you are not using a training computer you may have to download Python. To check if you have Python installed on your computer use the search function and search for Python.

If Python3.x is installed on your computer proceed to Step 1.


1) Open the Command Prompt

On the training computer the Command Prompt can be found by clicking the Start Menu, then finding the Most used category.


2) In the command prompt type:

    cd /

This directs you to the C drive.


3) In the command prompt type:

  cd FMEData2018/Resources/RESTAPI


4) In the command prompt type:

python -m http.server

This is the command to start the server which will be hosted locally.


5) Open up browser and type in: http://localhost:8000/


6) Navigate to My First App

Select myFirstApp. Then, select myFirstApp.html. This is a fully functioning web application that we will be creating in the next exercise.


CONGRATULATIONS
By completing this exercise you have learned how to:
  • Use Python to create a simple server

results matching ""

    No results matching ""