We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 952afc9 commit 9e080b0Copy full SHA for 9e080b0
index.ts
@@ -1,22 +1,20 @@
1
/**
2
* Entry point for the application.
3
* */
4
-import axios from 'axios';
5
import cp from 'child_process';
6
import fs from 'fs';
7
8
async function start() {
9
if (process.env.PROVIDER === 'gce' && !fs.existsSync('/usr/src/.env')) {
10
- const resp = await axios.get(
+ const resp = await fetch(
11
'http://metadata.google.internal/computeMetadata/v1/project/attributes/env',
12
{
13
headers: {
14
'Metadata-Flavor': 'Google',
15
},
16
- responseType: 'arraybuffer',
17
18
);
19
- fs.writeFileSync('/usr/src/.env', resp.data);
+ fs.writeFileSync('/usr/src/.env', await resp.text());
20
}
21
if (process.env.ROLE) {
22
// if role variable is set just run that script
0 commit comments