forked from ga-wdi-exercises/compliment-express
-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
34 lines (30 loc) · 704 Bytes
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
var express = require('express');
var app = express();
app.set("view engine", "hbs");
app.use(express.static('public'));
var compliments = [
"Your are super flippin kewt",
"Dig your shirt",
"GOALS AF",
"Marry me?",
"Peace 2 U 4 U R A QT"
]
colors = ["#FFBF00", "#0080FF","#01DF3A","#FF0080"]
names = [
"Harry",
"Jerry",
"Mary",
"Larry",
"Barry"
]
app.get("/", function(req, res){
var index = Math.floor(Math.random() * compliments.length);
var colorIndex = Math.floor(Math.random() * colors.length);
res.render("index", {
compliment: compliments[index],
color: colors[colorIndex]
});
})
app.listen(3001, function(){
console.log("HELP")
});