-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
30 lines (18 loc) · 737 Bytes
/
Copy pathindex.js
File metadata and controls
30 lines (18 loc) · 737 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
'use strict';
// Imports dependencies and set up http server
const express = require('express');
const app = express();
const path = require('path');
/* app.get('/', function(req, res){
res.send('Hi I am a messenger bot');
});*/
//assuming app is express Object.
app.get('/',function(req,res) {
res.header("Access-Control-Allow-Origin", "*");
res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
res.sendFile(path.join(__dirname+'/index.html'));
});
app.use('/',express.static(__dirname));
//app.use(express.static('public'));
//app.use(express.static(__dirname + '/'));
app.listen(process.env.PORT || 5000, () => console.log('DanfoBot is listening at 5000'));