forked from robbie-cahill/tunnelmole-service
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.ts
31 lines (25 loc) · 884 Bytes
/
app.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
27
28
29
30
31
//@ts-ignore
import tunnelmoleConnections from './src/handlers/tunnelmole-connections';
import handleRequest from './src/handlers/handle-request';
import logTelemetry from './src/handlers/log-telemetry';
import express from 'express';
import bodyParser from 'body-parser';
import unreserveSubdomain from './src/handlers/unreserve-subdomain';
const app = express();
// Body will be a Buffer, easy to transfer to the client untouched
const options = {
inflate: false,
type: '*/*'
};
app.use(bodyParser.raw(options));
app.get("/tunnelmole-connections", tunnelmoleConnections);
app.post("/tunnelmole-log-telemetry", logTelemetry);
app.delete("/tunnelmole/unreserve-subdomain", unreserveSubdomain);
/**
* Handle incoming HTTP(s) requests for existing connections
*/
app.all("*", handleRequest);
/**
* Initialize a new WebSocket connection with a Client
*/
export default app;