Skip to content

Commit

Permalink
edit stretch goals
Browse files Browse the repository at this point in the history
  • Loading branch information
shannonjensen committed Mar 19, 2018
1 parent 3bb0c87 commit 8ecaf4e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 20 deletions.
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"git.ignoreLimitWarning": true
}
8 changes: 0 additions & 8 deletions step10.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,6 @@ fs.writeFile('path/to/file', yourData, (error) {

If all the steps have gone well, you should have a fully functional CMS!

Lastly, you can commit your final changes and push to github:
```bash
git add .
git commit -m 'enter relevant message'
git push origin master
```


🎉CONGRATULATIONS!!🎉
===

Expand Down
14 changes: 2 additions & 12 deletions stretch.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,9 @@ It would be a great idea to create a new branch on Git for yourself, so you can


### More modularisation!
Currently, `handler.js` is a combination of decisions and actions. The decisions are the the if-else branches that look at the request url, and the actions are the bits inside the curly brackets.
Currently, `router.js` is a combination of decisions and actions. The decisions are the the if-else branches that look at the request url, and the actions are the bits inside the curly brackets.

You could split out the decision part to its own file, `routes.js`. Then the actual actions (so, the functions you call) would remain in `handler.js`. `routes.js`.

Then your server would require `routes.js`, instead of `handler.js`.
You could split out the actions part to its own file, `handlers.js`. Then the decisions would remain in `router.js` and the actions (the functions you call) would be in `handlers.js`.

Here are some links to an example of this in a different project:
- [server](https://github.com/node-girls/workshop-2015/blob/example/server.js#L6-Lundefined)
Expand All @@ -29,14 +27,6 @@ Here are some links to an example of this in a different project:
Testing is important - it's much easier to debug a broken project that has tests. If you want to introduce testing into your project, you can read more about it [here](http://code.tutsplus.com/tutorials/testing-in-nodejs--net-35018).


### Use a database
Instead of writing to a file on your hard drive, you could save your blog posts in a database, which would be much quicker in terms of performance if there was a lot of data.

* [MongoDB](https://docs.mongodb.org/getting-started/node/)
* [Redis]



### Host your blog online!
Heroku is a what we call a *Platform as a Service*. You upload your code to them and it will live on one of their servers, meaning you can access it on the general internet from anywhere!

Expand Down

0 comments on commit 8ecaf4e

Please sign in to comment.