mirror of
https://github.com/seejohnrun/haste-server.git
synced 2025-12-19 16:21:28 +00:00
Add tests and fix docker files
This commit is contained in:
@@ -1,9 +1,14 @@
|
||||
import * as fs from 'fs'
|
||||
import * as path from 'path'
|
||||
|
||||
import { Config } from '../../types/config'
|
||||
|
||||
const getConfig = (): Config => {
|
||||
const configPath = process.argv.length <= 2 ? 'config.json' : process.argv[2]
|
||||
const config = JSON.parse(fs.readFileSync(configPath, 'utf8'))
|
||||
const configPath =
|
||||
process.argv.length <= 2 ? 'project-config.js' : process.argv[2]
|
||||
const config = JSON.parse(
|
||||
fs.readFileSync(path.join('config', configPath), 'utf8'),
|
||||
)
|
||||
|
||||
config.port = (process.env.PORT || config.port || 7777) as number
|
||||
config.host = process.env.HOST || config.host || 'localhost'
|
||||
|
||||
Reference in New Issue
Block a user