WebFund 2013F: Tutorial 9: Difference between revisions
No edit summary |
No edit summary |
||
Line 8: | Line 8: | ||
* 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 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. | * 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. |
Revision as of 06:33, 8 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.