From 136831467b87ecd7221fb934749573c063ae1ece Mon Sep 17 00:00:00 2001 From: Jay Clegg <89157780+jclegg03@users.noreply.github.com> Date: Tue, 10 Mar 2026 18:16:29 -0600 Subject: [PATCH] Update simonService.md The curl commands couldn't run with the example code given. It has been updated to have all the code students need to put the example together and run it piece by piece. --- instruction/simon/simonService/simonService.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/instruction/simon/simonService/simonService.md b/instruction/simon/simonService/simonService.md index ce72e87e..695c9455 100644 --- a/instruction/simon/simonService/simonService.md +++ b/instruction/simon/simonService/simonService.md @@ -116,6 +116,8 @@ npm install cookie-parser bcryptjs uuid const cookieParser = require('cookie-parser'); const bcrypt = require('bcryptjs'); const uuid = require('uuid'); + +const authCookieName = "token"; ``` 1. **Parse JSON**. All of our endpoints use JSON and so we want Express to automatically parse that for us. @@ -124,6 +126,12 @@ const uuid = require('uuid'); app.use(express.json()); ``` +1. **Parse Cookies**. We also need to check the cookies we are storing so we also want Express to automatically manage that. + + ```js + app.use(cookieParser()); + ``` + 1. **Create the memory data structures**. Add data structures for both the users and the scores. That means whenever the service is restarted the users and scores will be lost. When we introduce the database in a later deliverable, the data will be persistent there. ```js