Developing the game's web UI
Please start your favorite Julia editor and open the sixdegrees/
folder we used in the previous chapter. It should contain all the files that we've worked on already—six_degrees.jl
, plus the Articles
, Database
, Gameplay
, and Wikipedia
modules.
Note
If you haven't followed through the code up to this point, you can download this chapter's accompanying support files, which are available at https://github.com/PacktPublishing/Julia-Programming-Projects/tree/master/Chapter05.
Add a new file for our web app. Since the code will be more complex this time and should integrate with the rest of our modules, let's define a WebApp
module within a new WebApp.jl
file. Then, we can add these first few lines of code:
module WebApp using HTTP, Sockets const HOST = ip"0.0.0.0" const PORT = 8888 const ROUTER = HTTP.Router() const SERVER = HTTP.Server(ROUTER) HTTP.serve(SERVER, HOST, PORT) end
No surprises here—similar to the previous example, we define constants for...