Thom Page 10 years ago
commit 248f575d20

@ -0,0 +1,20 @@
####1 What are the key differences between a server and a client?
####2 What is an HTTP request?
####3 What is the request-response cycle?
####4 Research what a 'node package' is and explain it.
####5 Research the node package 'Express' and explain why we might want to use it.
Video about NPM
https://www.youtube.com/watch?v=gvGjaqZducI&index=2&list=PLw1xVKFbouel1pRYoEMgNO53YTMN3TSYP
GIST:
https://gist.github.com/kristynrb/d89afd26c4c4421313bd

@ -0,0 +1,65 @@
![ga](http://mobbook.generalassemb.ly/ga_cog.png)
# WDI-PANTHALASSA
---
Title: Homework w05d02 <br>
Type: Homework<br>
Duration: "4:00"<br>
Creator:<br>
Original creators: WDI-Skywalker<br>
Adapted by: Thom Page & Kristyn Bryan<br>
Course: WDIr Panthalassa<br>
Competencies: Javascript, Express, Routes, Views, Node<br>
Prerequisites: Javascript <br>
---
#EXPRESS YOURSELF!!
## Learning Objectives
* Practice setting up express applications.
* Practice creating custom routes.
* Practice using parameters from a request.
####Tonight you will be using your new found skills to create three separate Express apps.
<br>
#Tip Calculator APP
- Create an express application (see the bottom of this homework for a reminder).
- Your app should have a route of `'/tip'` and it should expect *2 params*. One should be `total` and one should be `tipPercentage`.
- When hitting the route, the page should *display how much your tip will be* based on the total ammount of the bill and the tip percentage. (ex. hitting `'/tip/100/20'` should display `20` on the page).
**Commit 1** <br>
<hr>
"Commit 1: Tip Calculator express application created."
<hr>
<br>
#Magic 8 Ball APP
- Create an express application.
- Create a route of `'/magic'` that should expect a phrase in the URL that ask the Magic 8 ball a question.
- So if the user hits that route and asks a question of "Will I be a Millionaire" (ex. `'/magic/Will%20I%20Be%20A%20Millionaire'`) he should have return to him his question AND a random Magic 8 ball response (see the array below) on the screen.
- Remember that we can't use spaces in the url, so we use `%20` to express a space in the url.
- So if the user hits that route and asks a question of "Will I be a Millionaire" he should get his question asked and a random Magic 8 ball quote on the screen.
- Use this array of Magic 8 ball responses.....
```
["It is certain", "It is decidedly so", "Without a doubt", "Yes definitely","You may rely on it", "As I see it yes", "Most likely", "Outlook good","Yes", "Signs point to yes", "Reply hazy try again", "Ask again later","Better not tell you now", "Cannot predict now", "Concentrate and ask again","Don't count on it", "My reply is no", "My sources say no","Outlook not so good", "Very doubtful"]
```
**Commit 2** <br>
<hr>
"Commit 2: Magic 8 Ball express application created."
<hr>
# Example express application
<hr>
## Views
Index
Show
Module.export
Loading…
Cancel
Save