aboutsummaryrefslogtreecommitdiffhomepage
path: root/api/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'api/index.js')
-rw-r--r--api/index.js9
1 files changed, 5 insertions, 4 deletions
diff --git a/api/index.js b/api/index.js
index d45471c..9c7e63c 100644
--- a/api/index.js
+++ b/api/index.js
@@ -1,9 +1,9 @@
-require('dotenv/config')
const express = require('express')
const bodyParser = require('body-parser')
const cors = require('cors')
const morgan = require('morgan')
+const config = require('./config')
const applicationInit = require('./routes/application')
const keyboards = require('./routes/keyboards')
@@ -14,14 +14,15 @@ app.use(cors({
origin: 'https://nickcoutsos.github.io'
}))
-if (process.env.ENABLE_DEV_SERVER) {
+if (config.ENABLE_DEV_SERVER) {
applicationInit(app)
}
app.use(morgan('dev'))
-app.use(keyboards)
-app.use('/github', require('./routes/github'))
app.get('/health', (req, res) => res.sendStatus(200))
+app.use(keyboards)
+config.ENABLE_GITHUB && app.use('/github', require('./routes/github'))
+
module.exports = app