The easiest way to check that all is as it should be is to enter the following URL into any browser (Safari, Chrome, it doesn't matter which): http://127.0.0.1:8000/test.json.
Or, you can use this URL, which does exactly the same thing: localhost:8000/test.json.
In the browser window, you'll see the JSON data you put into test.json, pretty much as it appeared previously.
However, we are coders, are we not? Let's test the server in code, which will allow us to dig a little deeper into what is going on, and catch a first glimpse at Swift 3's new URLSession API:
- Create a new Cocoa Application Xcode project.
- Add a new Swift file, and call it HTTPRequestManager.swift.
- Under the import statement, add the following code:
class ...