Year #3, Week #6 đ» đ
New stuff we learned this week: đ€
Homework Plan
- 1 day Monkey Assignment #13
- 1 day review all flashcards in your app.
- 1 day touch typing practice
- 1 day King C reading assignment (chapter 7)
- 1 day King C exercizes
- 1 day Flashcards API Assignment
- 3 days Execute Program homework
King C Chapter 7 Projects đ
- First, make sure youâve slowly and carefully read all of chapter 7 of King C. assignment.
- Merge your
king-c
repo branch from last week, and CREATE A NEW BRANCH. - Complete the following programming projects (not exercizes) from chapter 3,
making a new file for every one:
2
4
5
6
10
11
12
13
14
Extra Creditâš (write psuedocode and extract functions to simplify)15
- commit your work, and push up a MR on GitLab
- before you slack me the URL, review your own diffs, clean up anything you notice, then slack me the URL.
Monkey #14 (Boolean Literals) đ
- Address all feedback from prior MRâs, and merge.
- Create a new branch.
- Start at section 2.8 - Extending the Parser. Work through that section, and commit your work when you get to the section labled Boolean Literals. The first video covers the first segment only.
- Next, work through the Boolean Literals section. The second video covers this section.
- As always, make sure to try to do as much as you can without the videos, but always also watch the videos and update your code to (mostly) match.
- Video link #1, Video link #2
- Submit a MR, Review your diffs and fixup!!, then slack the MR url
Flashcards API Restart
- Create a new folder, initialize an empty git repository
- add an empty
.gitignore
file, and make your first commit on themaster
branch - connect this new repo to a new project on GitLab
- make a new branch so I can see the rest of your work as MR.
- make a simple âhello worldâ express app that sends back the json
{"message":"hello world"}
at the path/
. - some requirements/hints:
- as discussed in class, we wonât be creating a compiled âdistâ dir of
compiled javascript, weâll be using
ts-node
to keep it simple - put the main file in
src/index.ts
- youâll need to setup a
tsconfig.json
file. Check out the typescript docs for more info, or refer to previous projects. - youâll need to bring in some npm packages to make this work, probably
including some
@types/*
packages. - youâll need to initialize the project with
npm
as well - donât install
nodemon
, weâll take a different approach with this repo. For now, donât worry about restarting automatically, weâll add that soon, just manually start/stop your server while youâre working on this. - add
.vscode/
dir with asettings.json
file, configured how you like it â at least exclude thenode_modules
directory from showing up in your sidebar and searches. - add two helper scripts in your
package.json
â one for running the api server in dev mode, and one for âproductionâ mode. They should start your API on two different ports, usingNODE_ENV
and your two ports assigned in~/.user_env
. - add one small feature â make sure it supports CORS out of the box. To
test this, run the command:
curl -H "Access-Control-Request-Method: GET" -H "Origin: http://fake-origin.com" --head http://localhost:<YOUR_PORT>
â you should see at least one access-control- header. Take a screenshot of youâre the output of this command, and include it in your MR.
- as discussed in class, we wonât be creating a compiled âdistâ dir of
compiled javascript, weâll be using
- when you think youâre done, commit your work, submit a MR. Make sure you attach your CORS screenshot. And then carefully review your code, cleaning up anything before I see it. Then Slack me the MR URL.