You've already forked dev-sidecar
mirror of
https://github.com/docmirror/dev-sidecar.git
synced 2025-11-26 14:10:40 +08:00
refactor: add a banner
This commit is contained in:
@@ -1,9 +1,16 @@
|
||||
const DevSidercar = require('.')
|
||||
const fs = require('fs')
|
||||
// require('json5/lib/register')
|
||||
// const config = require('../../config/index.json5')
|
||||
// 启动服务
|
||||
const mitmproxyPath = './mitmproxy'
|
||||
DevSidercar.api.startup({ mitmproxyPath })
|
||||
async function startup () {
|
||||
const banner = fs.readFileSync('./banner.txt')
|
||||
console.log(banner.toString())
|
||||
await DevSidercar.api.startup({ mitmproxyPath })
|
||||
console.log('dev-sidecar 已启动')
|
||||
}
|
||||
|
||||
async function onClose () {
|
||||
console.log('on sigint ')
|
||||
await DevSidercar.api.shutdown()
|
||||
@@ -11,3 +18,5 @@ async function onClose () {
|
||||
process.exit(0)
|
||||
}
|
||||
process.on('SIGINT', onClose)
|
||||
|
||||
startup()
|
||||
|
||||
Reference in New Issue
Block a user