-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
35 lines (25 loc) · 849 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
31
32
33
34
35
const express = require('express');
const bodyParser = require('body-parser');
const app = express();
const http = require('http').Server(app);
const twitter = require("./twitter");
const port = 3000;
const io = require('socket.io')(http);
// parse application/x-www-form-urlencoded
app.use(bodyParser.urlencoded({ extended: false }));
// parse application/json
app.use(bodyParser.json());
app.use(express.static('public'));
app.use('/static', express.static('public'))
app.set('view engine', 'ejs');
app.get('/', (req, res) => {
res.render('maps', {});
});
app.post("/location", (req, res) => {
const loc = req.body.loc;
twitter.push_query(loc, () => { });
})
// io.on("connection", socket => {
// console.log("new user connected");
// })
http.listen(port, () => console.log(`Example app listening on port ${port}!`));