Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a9bb1e6

Browse files
authored
Merge pull request HackYourFuture#535 from HackYourFuture/gajduk-patch-5
Update Week2 Homework
2 parents 923da74 + bf00938 commit a9bb1e6

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

week2/MAKEME.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,11 @@ This week you'll continue with the command line exercises. Go back to your comma
1919
2020
### Make a blog API
2121

22-
Anyone here still remember blogs!? They were all the rage around 10 years ago. We are a bit late to the party, but I think we can still make some money with a good blog API.
22+
Anyone here still remember blogs!? They were all the rage around 10 years ago. We are a bit late to the party, but I think we can still make some money with a blog application. Since you just learned about REST and APIs we are going to use them when writing this application. The resource in the application are `blogs`. Each blog will have a `title` and `content`.
2323

24-
In our API, blogs will have `title` and `content`. Let's jump right in.
24+
We also want our blogs to be stored `persistently` so that they do not dissapear when the Node.js application is restarted. To achieve this, each blog post will be stored as a separate file on the hard drive.
25+
26+
Let's start by setting up our environment.
2527

2628
**Setup:**
2729
Step 0. Creata a new empty folder e.g. `exercise1`
@@ -34,7 +36,7 @@ That was not too hard now was it. Now you are ready for the real coding. We will
3436

3537
**Creating new posts**
3638

37-
To create a new blog posts, users need to send a json in the body of the request, e.g. `{ "title": "My first blog", "content": "Lorem ipsum" }`. We are going to store the blog posts in separate files using the `fs` module. You can use the following starter code:
39+
To create a new blog posts, users need to send a json in the body of the request, e.g. `{ "title": "My first blog", "content": "Lorem ipsum" }`. We are going to store the blog posts in separate files using the `fs` module. The idea is that the name of the file will match the title of the blog popst while the content will be stored as the content of the file. You can use the following starter code:
3840

3941
```javascript
4042
const fs = require("fs");

0 commit comments

Comments
 (0)