MCPcopy Index your code
hub / github.com/triggerdotdev/trigger.dev / createTunnel

Method createTunnel

packages/yalt/src/index.ts:77–93  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

75 ) {}
76
77 async createTunnel(): Promise<string> {
78 const response = await fetch(`https://admin.${this.host}/api/tunnels`, {
79 method: "POST",
80 headers: {
81 accept: "application/json",
82 authorization: `Bearer ${this.apiKey}`,
83 },
84 });
85
86 if (!response.ok) {
87 throw new Error(`Could not create tunnel: ${response.status}`);
88 }
89
90 const body = (await response.json()) as any;
91
92 return body.id;
93 }
94
95 connectUrl(id: string): string {
96 return `${id}.${this.host}`;

Callers 1

actionFunction · 0.95

Calls 2

jsonMethod · 0.80
fetchFunction · 0.70

Tested by

no test coverage detected