(token: string | null, vmId: string | null)
| 49 | } |
| 50 | |
| 51 | async function getVMInfo(token: string | null, vmId: string | null): Promise<any> { |
| 52 | // send post request to gateway to get vm info and ssh keys |
| 53 | const gatewayHost = 'https://api.devbox.sh/g/vm_info'; |
| 54 | const data = new FormData(); |
| 55 | data.append("vm_id", vmId); |
| 56 | console.debug("calling devbox to get vm_info..."); |
| 57 | const response = await fetch(gatewayHost, { |
| 58 | method: 'post', |
| 59 | body: data, |
| 60 | headers: { |
| 61 | authorization: `Bearer ${token}` |
| 62 | } |
| 63 | }); |
| 64 | console.debug("API Call to api.devbox.sh response: " + response); |
| 65 | return response; |
| 66 | } |
| 67 | |
| 68 | async function setupDevboxLauncher(): Promise<any> { |
| 69 | // download devbox launcher script |
no test coverage detected