-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathstart.js
More file actions
29 lines (26 loc) · 927 Bytes
/
start.js
File metadata and controls
29 lines (26 loc) · 927 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
/**
* Serves static files in `src/` on port 1234 and exposes this publicly using ngrok
*/
const ngrok = require('ngrok')
const express = require('express')
const serveIndex = require('serve-index')
const cors = require('cors')
const app = express()
const root = './'
const port = 1234
app.use(cors())
app.use(express.static(root))
app.use('/', serveIndex(root))
app.listen(port, () => {
// if you have a paid ngrok account, put the subdomain you reserved below. If you don't,
// remove the subdomain parameter and ngrok will print the URL to the terminal
ngrok.connect({ addr: port, subdomain: 'profblair' }).then((url) => {
console.clear()
console.log('Custom room scripts served at:\n')
console.log(`> Local URL:\thttp://localhost:${port}`)
console.log(`> Public URL:\t${url}`)
console.log(
'\nNavigate to a room script and paste its public URL in your Hubs room settings'
)
})
})