Skip to content

Commit

Permalink
Static file.
Browse files Browse the repository at this point in the history
  • Loading branch information
Richard1984 committed Apr 7, 2019
1 parent 93002af commit a9924cb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 6 additions & 0 deletions server/routes/api/api.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
const express = require('express')
const router = express.Router()
const history = require('connect-history-api-fallback')
const env = process.env.NODE_ENV || 'development'

// Versions
const v1 = require('./v1/v1')

router.use('/v1', v1)

if (env === 'production') {
router.use(history())
}

module.exports = router
3 changes: 0 additions & 3 deletions server/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ const bodyParser = require('body-parser')
const cookieParser = require('cookie-parser')

const helmet = require('helmet')
const history = require('connect-history-api-fallback')
const compression = require('compression')
const morgan = require('morgan')
const cors = require('cors')
Expand All @@ -31,8 +30,6 @@ const io = socketIO(server)

if (env === 'development') {
app.use(morgan('dev'))
} else {
app.use(history())
}

app.use(bodyParser.json())
Expand Down

0 comments on commit a9924cb

Please sign in to comment.