Really Simple HTTP Server with Python
Part of Course: Introductory D3 Course
This Lesson is for subscribers
- How the web works basics involve web servers, HTTP protocol, IP Addresses, server responses, and server port numbers
- D3 has baked into it functionality that lets you load data into the browser asynchronously from a server
- Additionally, depending on the D3 Type-specific AJAX request, D3 will also parse the data for you
- D3 can request and parse text files, JSON files, XML files, HTML files, CSV files, TSV files, as well as allowing you to build and use your own parser
- The simplest server, Python SimpleHTTPServer, available on most computers comes as a module within the Python programming language
- To run the Python 2.7+ SimpleHTTPServer on the command line, type "python -m SimpleHTTPServer"
- To run the Python 3+ SimpleHTTPServer on the command line, type "python3 -m http.server"
- The Python SimpleHTTPServer serves to http://localhost:8000 (0.0.0.0:8000) all of the files in whichever directory you ran the command line commands