Preparing the landing page

Straight away, we can address the landing page handler. All it needs to do is display some static content describing the game's rules, as well as provide a way to start a new game with various levels of difficulty. Remember that the difficulty of the game determines the length of the article chain, and we need this information when we start a new game. We can pass it to the new game page as part of the URL, under the format /new/$difficulty_level. The difficulty levels are already defined in the Gameplay module, so don't forget to declare that we're using Gameplay.

Taking this into account, we'll end up with the following code for our WebApp module. We're putting everything together and we're also adding the landingpage ...

Get Julia 1.0 Programming Complete Reference Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.