-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathindex.js
More file actions
30 lines (25 loc) · 812 Bytes
/
index.js
File metadata and controls
30 lines (25 loc) · 812 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
const express = require('express');
const bodyParser = require('body-parser')
const cors = require('cors')
const stream = require('./controllers/stream')
const rules = require('./controllers/rules')
const api = require('./controllers/api')
const token = require('./controllers/token')
const stripe = require('./controllers/stripe')
const app = express();
const PORT = process.env.PORT || 4060;
app.use(bodyParser.json({strict:false}));
app.use(bodyParser.urlencoded({ extended: true }));
app.use(cors());
app.options('*', cors())
app.post('*', cors())
app.use('/stream',stream);
app.use('/rules',rules);
app.use('/api', api)
app.use('/token', token)
app.use('/stripe',stripe);
app.listen(PORT, ()=> {
console.log("App listening on port",PORT);
//stream.streamTweets();
});
module.exports = app;