mirror of
https://github.com/seejohnrun/haste-server.git
synced 2026-02-10 16:01:32 +00:00
fix pr comments
This commit is contained in:
@@ -10,14 +10,15 @@ const getConfig = (): Config => {
|
||||
fs.readFileSync(path.join('config', configPath), 'utf8')
|
||||
)
|
||||
|
||||
config.port = (process.env.PORT || config.port || 7777) as number
|
||||
config.port = Number(process.env.PORT) || config.port || 7777
|
||||
config.host = process.env.HOST || config.host || 'localhost'
|
||||
|
||||
if (!config.storage) {
|
||||
config.storage = { type: 'file' }
|
||||
config.storage = {}
|
||||
}
|
||||
if (!config.storage.type) {
|
||||
config.storage.type = 'file'
|
||||
|
||||
if (!config.storeName) {
|
||||
config.storeName = 'file'
|
||||
}
|
||||
|
||||
return config
|
||||
|
||||
@@ -4,4 +4,4 @@ export const getStaticDirectory = (baseDirectory: string) =>
|
||||
path.join(baseDirectory, '..', 'static')
|
||||
|
||||
export const getStaticItemDirectory = (baseDirectory: string, item: string) =>
|
||||
path.join(baseDirectory, '..', 'static', item)
|
||||
path.join(getStaticDirectory(baseDirectory), item)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import * as winston from 'winston'
|
||||
import type { Config } from 'src/types/config'
|
||||
import { Logging, LoggingType } from 'src/types/log'
|
||||
|
||||
const addLogging = (config: Config) => {
|
||||
try {
|
||||
@@ -8,8 +9,8 @@ const addLogging = (config: Config) => {
|
||||
/* was not present */
|
||||
}
|
||||
|
||||
let detail
|
||||
let type
|
||||
let detail: Logging
|
||||
let type: LoggingType
|
||||
|
||||
for (let i = 0; i < config.logging.length; i += 1) {
|
||||
detail = config.logging[i]
|
||||
|
||||
Reference in New Issue
Block a user