mirror of
https://github.com/kaythomas0/noisedash.git
synced 2025-11-15 12:47:58 +00:00
Fix serving static files with connect-history-api-fallback
This commit is contained in:
@@ -18,14 +18,18 @@ const fileStoreOptions = {
|
|||||||
require('./boot/db')()
|
require('./boot/db')()
|
||||||
require('./boot/auth')()
|
require('./boot/auth')()
|
||||||
|
|
||||||
app.use(history())
|
|
||||||
app.use(express.json())
|
app.use(express.json())
|
||||||
app.use(express.urlencoded({ extended: false }))
|
app.use(express.urlencoded({ extended: false }))
|
||||||
app.use(cookieParser())
|
app.use(cookieParser())
|
||||||
if (process.env.NODE_ENV === 'production') {
|
if (process.env.NODE_ENV === 'production') {
|
||||||
app.use(express.static(path.join(__dirname, '../dist')))
|
app.use(express.static(path.join(__dirname, '../dist')))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Workaround for allowing static files to be served while using connect-history-api-fallback
|
||||||
app.use('/samples', express.static(path.join(__dirname, '../', config.get('Server.sampleUploadPath'))))
|
app.use('/samples', express.static(path.join(__dirname, '../', config.get('Server.sampleUploadPath'))))
|
||||||
|
app.use(history())
|
||||||
|
app.use('/samples', express.static(path.join(__dirname, '../', config.get('Server.sampleUploadPath'))))
|
||||||
|
|
||||||
app.use(session({
|
app.use(session({
|
||||||
store: new FileStore(fileStoreOptions),
|
store: new FileStore(fileStoreOptions),
|
||||||
secret: config.get('Server.sessionSecret'),
|
secret: config.get('Server.sessionSecret'),
|
||||||
|
|||||||
Reference in New Issue
Block a user