-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
30 lines (21 loc) · 774 Bytes
/
index.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
var express = require('express');
var app = express();
var path = require ("path");
// set the port of our application
// process.env.PORT lets the port be set by Heroku
var port = process.env.PORT || 5000;
// set the view engine to ejs
app.set('view engine', 'ejs');
// make express look in the public directory for assets (css/js/img)
app.use(express.static(__dirname + '/'));
// set the home page route
app.get('/', function(req, res) {
// res.json({'some':'value'});
// ejs render automatically looks in the views folder
// res.render('thingspeak.html');
res.sendFile(path.join(__dirname+'/thingspeak.html'));
});
app.listen(port, function() {
console.log('Our app is running on http://localhost:' + port);
});
// console.log('Hi Vighnesh')