detached.js 316 B

123456789101112
  1. 'use strict'
  2. const fs = require('fs')
  3. const Server = require('./server')
  4. const configurationFile = process.argv[2]
  5. const fileContents = fs.readFileSync(configurationFile, 'utf-8')
  6. fs.unlink(configurationFile, function () {})
  7. const data = JSON.parse(fileContents)
  8. const server = new Server(data)
  9. server.start(data)