forked from Mirrors/keyoxide-web
Fix module state detection
This commit is contained in:
parent
79a259f028
commit
751e141f91
3 changed files with 9 additions and 5 deletions
|
@ -33,10 +33,11 @@ import proxyGetApiRouter from './proxy_get.js'
|
|||
|
||||
const router = express.Router()
|
||||
|
||||
if (process.env.ENABLE_MAIN_MODULE ?? true) {
|
||||
if (process.env.ENABLE_MAIN_MODULE === 'true') {
|
||||
router.use('/profile', keyoxideProfileApiRouter)
|
||||
}
|
||||
if (process.env.ENABLE_PROXY_MODULE ?? true) {
|
||||
console.log(process.env.ENABLE_PROXY_MODULE);
|
||||
if (process.env.ENABLE_PROXY_MODULE === 'true') {
|
||||
router.use('/get', proxyGetApiRouter)
|
||||
}
|
||||
|
||||
|
|
|
@ -72,7 +72,9 @@ app.use(stringReplace({
|
|||
}))
|
||||
|
||||
// Routes
|
||||
if (process.env.ENABLE_MAIN_MODULE ?? true) {
|
||||
app.use('/api', apiRoute)
|
||||
if (process.env.ENABLE_MAIN_MODULE === 'true') {
|
||||
console.log("lol", process.env.ENABLE_MAIN_MODULES);
|
||||
app.use('/favicon.svg', express.static('./static/favicon.svg'))
|
||||
app.use('/robots.txt', express.static('./static/robots.txt'))
|
||||
|
||||
|
@ -81,7 +83,6 @@ if (process.env.ENABLE_MAIN_MODULE ?? true) {
|
|||
app.use('/util', utilRoute)
|
||||
app.use('/', profileRoute)
|
||||
}
|
||||
app.use('/api', apiRoute)
|
||||
|
||||
app.listen(app.get('port'), () => {
|
||||
console.log(`Server listening at http://localhost:${app.get('port')}`)
|
||||
|
|
|
@ -34,7 +34,9 @@ import apiRouter2 from '../api/v2/index.js'
|
|||
|
||||
const router = express.Router()
|
||||
|
||||
router.use('/0', apiRouter0)
|
||||
if (process.env.ENABLE_MAIN_MODULE === 'true') {
|
||||
router.use('/0', apiRouter0)
|
||||
}
|
||||
router.use('/1', apiRouter1)
|
||||
router.use('/2', apiRouter2)
|
||||
|
||||
|
|
Loading…
Reference in a new issue