This repository has been archived on 2022-11-26. You can view files and clone it, but cannot push or open issues or pull requests.
teemant-old/server/config.js

16 lines
302 B
JavaScript
Raw Normal View History

2019-01-09 17:26:09 +00:00
import fs from 'fs'
import path from 'path'
import toml from 'toml'
2016-09-23 21:38:09 +00:00
2019-01-09 17:26:09 +00:00
const filename = path.join(__dirname, '..', 'client.config.toml')
let config
2016-09-23 21:38:09 +00:00
try {
2019-01-09 17:26:09 +00:00
config = toml.parse(fs.readFileSync(filename))
2016-09-23 21:38:09 +00:00
} catch (e) {
2019-01-09 17:26:09 +00:00
throw new Error('config.toml parse error: ', e.message)
2016-09-23 21:38:09 +00:00
}
2019-01-09 17:26:09 +00:00
module.exports = config