Skip to content

Commit dc8cfe5

Browse files
Madeny DiawaraMadeny Diawara
authored andcommitted
Auto updates
1 parent 4e30c36 commit dc8cfe5

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<h1>Hello i'm html in the root directory</h1>

server.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ app.set('view engine', 'jade');
66
app.use(express.static(__dirname + '/public'));
77

88

9+
10+
11+
12+
913
app.get('/',function(req,res) {
1014
messagebird.balance.read(function (err, response) {
1115
if (err) {
@@ -21,6 +25,20 @@ app.use(express.static(__dirname + '/public'));
2125
});
2226
});
2327

28+
// I now know how to send html from expressjs
29+
// here is the code below
30+
31+
// app.get('/',function(req,res) {
32+
// messagebird.balance.read(function (err, response) {
33+
// if (err) {
34+
// console.log(err);
35+
// } else
36+
// // res.render({balance:response.amount, type:response.type});
37+
// res.sendFile(__dirname + '/views/index.html', {
38+
// // type:response.type
39+
// balance:response.amount,
40+
// type:response.type
41+
2442

2543

2644
app.listen(3000, function () {

views/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<h1>Hello world I'm html file in the views directory</h1>

0 commit comments

Comments
 (0)