forked from animo/animo-mediator
-
Notifications
You must be signed in to change notification settings - Fork 1
/
dev.ts
26 lines (21 loc) · 653 Bytes
/
dev.ts
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
import { config } from 'dotenv'
import { connect } from '@ngrok/ngrok'
config()
const port = 3000
/**
* Connect to ngrok and then set the port and url on the environment before importing
* the index file.
*/
// TODO: have to add auth token now to use ngrok check this later
void connect({
port,
}).then((app) => {
// eslint-disable-next-line no-console
console.log('Got ngrok url:', app.url())
const url = app.url()
process.env.NODE_ENV = 'development'
process.env.AGENT_PORT = `${port}`
process.env.AGENT_ENDPOINTS = `${url},${url?.replace('http', 'ws')}`
process.env.SHORTENER_BASE_URL = `${url}/s`
require('./src/index')
})