From 695203b58dc7f785023302e901ebeb942bbee442 Mon Sep 17 00:00:00 2001 From: Albert Rigo Date: Mon, 4 Mar 2019 17:10:42 +0100 Subject: [PATCH 1/9] link within FooCoding --- README.md | 24 ++++++++++++------------ week3/README.md | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 83512e18f..d5bddcd2b 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ > Please help us improve and share your feedback! If you find better tutorials -or links, please share them by [opening a pull request](https://github.com/HackYourFuture/Node.js/pulls). +or links, please share them by [opening a pull request](https://github.com/FooCoding/Node.js/pulls). -# HackYourFuture - Node.js +# Node.js This 3-week HYF Module is about Node.js. We can think of Node.js as "Javascript not running in a browser". This is what we mean by "backend", as in "backend @@ -26,8 +26,8 @@ Read first weeks's [README.md](week1/README.md). Reading: -Read Jim's summaries of [promises](https://github.com/HackYourFuture/fundamentals/blob/master/fundamentals/promises.md) -and [async & await](https://github.com/HackYourFuture/fundamentals/blob/master/fundamentals/async_await.md) +Read Jim's summaries of [promises](https://github.com/FooCoding/fundamentals/blob/master/fundamentals/promises.md) +and [async & await](https://github.com/FooCoding/fundamentals/blob/master/fundamentals/async_await.md) from JavaScript module [Promises, async/await](http://javascript.info/async) @@ -47,11 +47,11 @@ instructions depending on your operating system: We will build on knowledge from the following HYF (sub)modules. If we feel we have gaps we should review the curriculum ourselves or ask a teacher to help. -- [JavaScript1](https://github.com/HackYourFuture/JavaScript1) -- [JavaScript2](https://github.com/HackYourFuture/JavaScript2) -- [JavaScript3](https://github.com/HackYourFuture/JavaScript3) -- [Git](https://github.com/HackYourFuture/Git) -- [Bash/Command Line Interface](https://github.com/HackYourFuture/CommandLine) +- [JavaScript1](https://github.com/FooCoding/JavaScript1) +- [JavaScript2](https://github.com/FooCoding/JavaScript2) +- [JavaScript3](https://github.com/FooCoding/JavaScript3) +- [Git](https://github.com/FooCoding/Git) +- [Bash/Command Line Interface](https://github.com/FooCoding/CommandLine) ## What will we learn? @@ -85,7 +85,7 @@ There are two reasons why we at HYF chose Node.js over others: Take a look at [this video](https://www.youtube.com/watch?v=-o0yomUVVpU) made by Daan, he explains how your homework needs to be handed in from now on. -Also review the [Git workflow material](https://github.com/HackYourFuture/Git/blob/master/Lecture-3.md) +Also review the [Git workflow material](https://github.com/FooCoding/Git/blob/master/Lecture-3.md) and use it as a reference. ## Rewatch previous lectures @@ -94,5 +94,5 @@ and use it as a reference. - Lecture 2 (Joost): https://www.youtube.com/watch?v=pY7IDaLX-no - Lecture 3 (Joost): https://www.youtube.com/watch?v=oeWCqKJsHtU&t=99s -*The HackYourFuture curriculum is subject to CC BY copyright. This means you can freely use our materials, but just make sure to give us credit for it :)* - +--- +Credit goes to [HackYourFuture](https://github.com/HackYourFuture) which this is based upon. diff --git a/week3/README.md b/week3/README.md index 6cecaffbf..15e4634fa 100644 --- a/week3/README.md +++ b/week3/README.md @@ -117,6 +117,6 @@ Check [README.md](homework/README.md) in `homework` subdirectory. ## Prepare for the next module -Check out the [databases repository](https://github.com/HackYourFuture/databases) +Check out the [databases repository](https://github.com/FooCoding/databases) and find out how you can prepare for the first database lecture, Jason and Rob have provided a nice Lynda playlist so we can have a flying kick off. From 3be7862fe82de9ec8b58e2be4baff83204026158 Mon Sep 17 00:00:00 2001 From: Radhikajram Date: Mon, 30 Sep 2019 19:41:29 +0530 Subject: [PATCH 2/9] Corrected POST and DELETE request to PATCH. --- week3/homework/README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/week3/homework/README.md b/week3/homework/README.md index ca7b75298..718a420d6 100644 --- a/week3/homework/README.md +++ b/week3/homework/README.md @@ -9,19 +9,19 @@ Add four more actions: ### `readTodo` (`GET /todos/:id`) - Get a single to-do with ID `:id` +Get a single to-do with ID `:id` ### `clearTodos` (`DELETE /todos`) - Clears the list of to-dos +Clears the list of to-dos -### `markAsDone` (`POST /todos/:id/done`) +### `markAsDone` (PATCH /todos/:id) - Sets the `done` flag of a single to-do to `true` +Sets the done flag of a single to-do to true -### `markAsNotDone` (`DELETE /todos/:id/done`) +### `markAsNotDone` (PATCH /todos/:id) - Sets the `done` flag of a single to-do to `false` +Sets the done flag of a single to-do to false ## Requirements From a87ed97c779c6de37bec6a7c14e659061c0c30a9 Mon Sep 17 00:00:00 2001 From: Radhikajram Date: Tue, 1 Oct 2019 14:50:13 +0530 Subject: [PATCH 3/9] Corrected end point and backticks. --- week3/homework/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/week3/homework/README.md b/week3/homework/README.md index 718a420d6..ae75b3b9f 100644 --- a/week3/homework/README.md +++ b/week3/homework/README.md @@ -15,13 +15,13 @@ Get a single to-do with ID `:id` Clears the list of to-dos -### `markAsDone` (PATCH /todos/:id) +### `markAsDone` (PATCH /todos/:id/done) -Sets the done flag of a single to-do to true +Sets the `done` flag of a single to-do to `true` -### `markAsNotDone` (PATCH /todos/:id) +### `markAsNotDone` (PATCH /todos/:id/done) -Sets the done flag of a single to-do to false +Sets the `done` flag of a single to-do to `false` ## Requirements From aa516dba772ad10bc49ddf7c1aaef87d4dbdb692 Mon Sep 17 00:00:00 2001 From: Radhikajram Date: Wed, 2 Oct 2019 13:38:43 +0530 Subject: [PATCH 4/9] Updated the PATCH details. --- week3/homework/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/week3/homework/README.md b/week3/homework/README.md index ae75b3b9f..ac9d90b79 100644 --- a/week3/homework/README.md +++ b/week3/homework/README.md @@ -15,11 +15,11 @@ Get a single to-do with ID `:id` Clears the list of to-dos -### `markAsDone` (PATCH /todos/:id/done) +### `markAsDone` (PATCH /todos/:id/) Sets the `done` flag of a single to-do to `true` -### `markAsNotDone` (PATCH /todos/:id/done) +### `markAsNotDone` (PATCH /todos/:id) Sets the `done` flag of a single to-do to `false` From b867341c1d1fa096abbcdd802ae25631e1d961e5 Mon Sep 17 00:00:00 2001 From: Radhikajram Date: Wed, 2 Oct 2019 13:40:58 +0530 Subject: [PATCH 5/9] Updated PATCH details --- week3/homework/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/week3/homework/README.md b/week3/homework/README.md index ac9d90b79..d7015eba6 100644 --- a/week3/homework/README.md +++ b/week3/homework/README.md @@ -15,13 +15,13 @@ Get a single to-do with ID `:id` Clears the list of to-dos -### `markAsDone` (PATCH /todos/:id/) +### `markAsDone` (`PATCH /todos/:id`) Sets the `done` flag of a single to-do to `true` -### `markAsNotDone` (PATCH /todos/:id) +### `markAsNotDone` (`PATCH /todos/:id`) -Sets the `done` flag of a single to-do to `false` +Sets the`done`flag of a single to-do to`false` ## Requirements From 937b6242d9cbc3186491814c890052d6054f46a0 Mon Sep 17 00:00:00 2001 From: Radhikajram Date: Sat, 5 Oct 2019 14:32:10 +0530 Subject: [PATCH 6/9] corrected MarkasDone as patchTodo --- week3/homework/README.md | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/week3/homework/README.md b/week3/homework/README.md index d7015eba6..d8878f5e5 100644 --- a/week3/homework/README.md +++ b/week3/homework/README.md @@ -15,13 +15,9 @@ Get a single to-do with ID `:id` Clears the list of to-dos -### `markAsDone` (`PATCH /todos/:id`) +### `patchTodo` (`PATCH /todos/:id`) -Sets the `done` flag of a single to-do to `true` - -### `markAsNotDone` (`PATCH /todos/:id`) - -Sets the`done`flag of a single to-do to`false` +Sets the `done` flag of a single to-do to `true` or false. ## Requirements From e7221f6663b2b0bc91dc9031bf90cbc83e11acb4 Mon Sep 17 00:00:00 2001 From: ChristerNilsson Date: Sat, 5 Oct 2019 18:06:22 +0200 Subject: [PATCH 7/9] Cleaned up after changing markAsdone --- week3/homework/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/week3/homework/README.md b/week3/homework/README.md index d8878f5e5..5fa76a3d3 100644 --- a/week3/homework/README.md +++ b/week3/homework/README.md @@ -5,7 +5,7 @@ Read through the code from the lecture, make sure you understand the flow of the program. -Add four more actions: +Add three more actions: ### `readTodo` (`GET /todos/:id`) @@ -17,7 +17,7 @@ Clears the list of to-dos ### `patchTodo` (`PATCH /todos/:id`) -Sets the `done` flag of a single to-do to `true` or false. +Sets the `done` and/or `description` fields of a single to-do. ## Requirements From 1278c0483ce3990a99f69fd081d789d0fca8e35d Mon Sep 17 00:00:00 2001 From: Marcus Thelin Date: Thu, 10 Oct 2019 13:47:11 +0200 Subject: [PATCH 8/9] Added new links --- week2/README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/week2/README.md b/week2/README.md index 3671c4dee..50c498e30 100644 --- a/week2/README.md +++ b/week2/README.md @@ -35,6 +35,13 @@ Documentation: [fs.appendFile()](https://nodejs.org/docs/latest-v8.x/api/fs.html#fs_fs_appendfile_file_data_options_callback) +### Working with streams in Node.js +[fs.readFile() vs fs.createReadStream()](https://medium.com/@dalaidunc/fs-readfile-vs-streams-to-read-text-files-in-node-js-5dd0710c80ea) + +[Node.js stream documentation](https://nodejs.org/api/stream.html) + +[Streams vs readFile and piping streams](https://www.freecodecamp.org/news/node-js-streams-everything-you-need-to-know-c9141306be93/) + ### Building a command line interface (CLI) [Node.js Process Documentation](https://nodejs.org/docs/latest-v8.x/api/process.html) From 1b70a82c433cbdc100274501970737a3a076461b Mon Sep 17 00:00:00 2001 From: Marcus Thelin Date: Thu, 10 Oct 2019 13:50:51 +0200 Subject: [PATCH 9/9] Added new bonus assignment --- week2/homework/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/week2/homework/README.md b/week2/homework/README.md index 163cade0b..4b69b04ff 100644 --- a/week2/homework/README.md +++ b/week2/homework/README.md @@ -64,6 +64,7 @@ node index.js reset ## Bonus assignment - Use JSON to store to-dos +- Read, write and remove todos to and from JSON files using streams. - Split each action (i.e. read, write, etc.) into a separate file - Use [commander](https://www.npmjs.com/package/commander) library to implement command line interface