1
0
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:
Yusuf Yilmaz
2022-05-27 15:04:54 +02:00
parent 9f45927593
commit f527b13535
30 changed files with 2126 additions and 4468 deletions

View File

@@ -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'