#140 : Individual log files
This commit is contained in:
@ -9,9 +9,9 @@ import tileRepository from '../repositories/tileRepository'
|
||||
import objectRepository from '../repositories/objectRepository'
|
||||
import spriteRepository from '../repositories/spriteRepository'
|
||||
import fs from 'fs'
|
||||
import logger from './logger'
|
||||
import zoneRepository from '../repositories/zoneRepository'
|
||||
import zoneManager from '../managers/zoneManager'
|
||||
import { httpLogger } from './logger'
|
||||
|
||||
async function addHttpRoutes(app: Application) {
|
||||
/**
|
||||
@ -118,13 +118,13 @@ async function addHttpRoutes(app: Application) {
|
||||
}
|
||||
|
||||
if (!fs.existsSync(assetPath)) {
|
||||
logger.error(`File not found: ${assetPath}`)
|
||||
httpLogger.error(`File not found: ${assetPath}`)
|
||||
return res.status(404).send('Asset not found')
|
||||
}
|
||||
|
||||
res.sendFile(assetPath, (err) => {
|
||||
if (err) {
|
||||
logger.error('Error sending file:', err)
|
||||
httpLogger.error('Error sending file:', err)
|
||||
res.status(500).send('Error downloading the asset')
|
||||
}
|
||||
})
|
||||
@ -179,7 +179,7 @@ async function addHttpRoutes(app: Application) {
|
||||
return res.status(400).json({ message: 'Failed to register user' })
|
||||
})
|
||||
|
||||
logger.info('Web routes added')
|
||||
httpLogger.info('Web routes added')
|
||||
}
|
||||
|
||||
export { addHttpRoutes }
|
||||
|
Reference in New Issue
Block a user