forked from LucasssMODS/LoliKiller-Api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
24 lines (19 loc) · 619 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
var express = require('express'),
cors = require('cors'),
secure = require('ssl-express-www');
const PORT = process.env.PORT || 8080 || 5000 || 3000
var { color } = require('./lib/color.js')
var mainrouter = require('./routes/main'),
apirouter = require('./routes/api')
var app = express()
app.enable('trust proxy');
app.set("json spaces",2)
app.use(cors())
app.use(secure)
app.use(express.static("public"))
app.use('/main', mainrouter)
app.use('/api', apirouter)
app.listen(PORT, () => {
console.log(color("Server running on port " + PORT,'green'))
})
module.exports = app