Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions instruction/simon/simonService/simonService.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand Down