Kristyn Bryan 10 years ago
commit 70272ea8a8

@ -15,7 +15,7 @@ Prerequisites: Javascript <br>
---
#EXPRESS YOURSELF!!
#Express Yourself
## Learning Objectives
@ -23,21 +23,34 @@ Prerequisites: Javascript <br>
* 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.
<hr>
Tonight you will be using your new found skills to create three separate Express apps.
<br>
##Greetings APP
- Create an express application (see the bottom of this homework for a reminder).
- Your app should have a route of `'/greeting/:name'` and it should expect *1 param* which takes in a person's name.
- When hitting the route, the page should display a message such as "Hello, <name>", or "What's up, `<name>`", or "`<name>`! It's so great to see you!" (ex. hitting `'/greeting/Jimmy-boy'` should display `Wow! Hello there, Jimmy-boy` on the page).
**Commit 1** <br>
<hr>
"Commit 1: Greeting express application created."
<hr>
<br>
#Tip Calculator APP
##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>
**Commit 2** <br>
<hr>
"Commit 1: Tip Calculator express application created."
"Commit 2: Tip Calculator express application created."
<hr>
<br>
#Magic 8 Ball APP
##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.
@ -49,18 +62,20 @@ Prerequisites: Javascript <br>
["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>
**Commit 3** <br>
<hr>
"Commit 2: Magic 8 Ball express application created."
"Commit 3: Magic 8 Ball express application created."
<hr>
# Reminder on how to set up an express application
## Reminder on how to set up an express application
- Create a Javascript file (`.js`) for each express application (ex: `tip_calculator.js`).
- Inside your homework folder, install express `npm install --save express`
- Check your files. Hint: `ls`. If you have a `node_modules` folder with `express` somewhere inside, then you've successfully added express to your folder.
- Inside your Javascript file,
-
- Inside your Javascript file, require `express` (look back to the markdown from today if you need more help on how to do this)
- Install express on our server.
- Tell the server where to listen for requests (the port).
As a reminder, to get and send information, refer to this example:
```
app.get('/greeting/:name', function(req, res) {
res.send({params: req.params, queries: req.query})
@ -68,9 +83,7 @@ app.get('/greeting/:name', function(req, res) {
```
<hr>
## Views
Index
Show
Module.export
# Views Homework
Go to the folder called `Pokeman_Starter` for the next part of your homework

@ -0,0 +1,43 @@
![ga](http://mobbook.generalassemb.ly/ga_cog.png)
# WDI-PANTHALASSA
---
Title: Morning Exercise - Stopwatch w05d02 <br>
Type: Morning Exercise<br>
Duration: "0:45"<br>
Creator:<br>
Original creators: WDI-Meeseeks, WDI-Archer, WDI-Funke<br>
Adapted by: Thom Page & Kristyn Bryan<br>
Course: WDIr Panthalassa<br>
Competencies: Javascript, HTML, CSS<br>
Prerequisites: Javascript, HTML, CSS <br>
---
# Morning Exercise
STOP! WATCH TIME!
![stopwatch](http://www.featurepics.com/FI/Thumb300/20110915/Digital-Stopwatch-1998985.jpg)
## Stopwatch time = partner time!
We will put you in pairs to work on this exercise. One of you should be the driver while the other is the navigator.
Lets write a browser stopwatch app. Here are the user stories.
1. The user should be able to see the current amount of time that has gone by at any given point.
2. The user should be able to start the stopwatch.
3. the user should be able to stop the stopwatch.
4. The user should be able to reset the stopwatch.
5. Bonus: The user should be able to [make and reset splits](http://news.runtowin.com/2007/05/08/what-is-the-difference-between-split-times-and-lap-times.html) that appear somewhere on the page.
We have given you the starter file to use with a basic layout for the html so that you can focus on the Javascript. Before you start to code, organize your thoughts by asking these questions:
1. What information am I going to need to store.
2. What events will I need and how will I have them interact with the web page.
3. What kind of funtions will I need in order to change the data?
Hint: When you get to the "reset" portion of your stopwatch, try Javascript's `setInterval()` method.
When time is up, remember to share your code with your partner.
Loading…
Cancel
Save