aboutsummaryrefslogtreecommitdiffhomepage
path: root/api/index.js
diff options
context:
space:
mode:
authorNick Coutsos <[email protected]>2022-04-28 23:52:20 -0400
committerNick Coutsos <[email protected]>2022-04-28 23:52:20 -0400
commit94efab0e1ac5cb65a85f47b376b111cf00989052 (patch)
treeef2cf0e76db3f0ff5108fb603cf3f87644e65806 /api/index.js
parent7f6b1db5f9cc50eb3b30bfea95fe677641340723 (diff)
parent260f0c6f3dc841cbe5fbf290d2b802e8acdb20b6 (diff)
downloadkeymap-editor-94efab0e1ac5cb65a85f47b376b111cf00989052.tar.gz
keymap-editor-94efab0e1ac5cb65a85f47b376b111cf00989052.zip
Merge branch 'main' into react-app
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