forked from fundingrate/tradingview-webhooks
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
32 lines (26 loc) · 682 Bytes
/
Copy pathindex.js
File metadata and controls
32 lines (26 loc) · 682 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
require('dotenv').config()
const assert = require('assert')
const { parseEnv } = require('./libs/utils')
const config = parseEnv(process.env)
assert(config.name, 'app requires a name')
console.log('ENV', config)
const App = require(`./apps/${config.name}`)
assert(App, 'app not found')
const Web = require('actions-http')
App(config)
.then((x={}) => {
console.log(config.name, 'Online')
return Web(config, x)
})
.catch(e => {
console.log(e)
process.exit(1)
})
process.on('unhandledRejection', function(err, promise) {
console.log(err)
process.exit(1)
})
process.on('uncaughtException', function(err) {
console.log(err.stack)
process.exit(1)
})