Difference between revisions of "WebFund 2013F: Tutorial 9"

From Soma-notes
Jump to navigation Jump to search
Line 9: Line 9:
* Modify the server code so that if the password "openSesame" is included in the post request, it allows users to enter the secret room.  If users give the wrong password or no password at all, they should get redirected to the void.
* Modify the server code so that if the password "openSesame" is included in the post request, it allows users to enter the secret room.  If users give the wrong password or no password at all, they should get redirected to the void.
* [BONUS] Modify the server so only allows users to exit using valid exits for the current room.
* [BONUS] Modify the server so only allows users to exit using valid exits for the current room.
==Code==

Revision as of 14:21, 11 November 2013

In this tutorial you will be modifying adventure-ajax-demo, an updated version of Simple Adventure that now uses asynchronous background requests (AJAX) to navigate between rooms and update the page.

First, grab the code, either with modules or without. Then unzip it and get it running as usual. (If you download the version with modules, you shouldn't need to run npm install.)

Do the following:

  • Create a room, the Holodeck, which is just connected to sick bay.
  • Get to the secret room by editing and re-sending a post request.
  • Modify the server code so that attempts to get to non-existent rooms instead send you to the Void.
  • Modify the server code so that if the password "openSesame" is included in the post request, it allows users to enter the secret room. If users give the wrong password or no password at all, they should get redirected to the void.
  • [BONUS] Modify the server so only allows users to exit using valid exits for the current room.

Code