-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathapp2.js
More file actions
47 lines (34 loc) · 763 Bytes
/
app2.js
File metadata and controls
47 lines (34 loc) · 763 Bytes
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
35
36
37
38
39
40
41
42
43
44
45
46
47
var express = require('express');
var app = express();
var ejs = require('ejs');
app.set('view engine', 'ejs');
app.get('/', function (req, res) {
data = {
properties: properties,
pageTitle: "Properties index!"
}
var html ="<ul>";
properties.forEach(function(property){
html += "<li>"+ proprety.ownerName +"</li>";
});
//res.render('index',{data: data});
});
app.listen(3000, function () {
console.log('Example app listening on port 3000!');
});
console.log('hi');
var properties = [
{
ownerName: "David Jones",
address: "123 Main Street"
},
{
ownerName: "Bob Johnson",
address: "345 Einsenhower Blvd"
},
{
ownerName: "Mary Smith",
address: "678 Spruce St."
}
];
console.log(properties);