Skip to content

Instantly share code, notes, and snippets.

@simonprickett
Created July 17, 2018 02:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save simonprickett/45ec417a72f70cfb2ebb1adb280d3657 to your computer and use it in GitHub Desktop.
Save simonprickett/45ec417a72f70cfb2ebb1adb280d3657 to your computer and use it in GitHub Desktop.
Google Cloud Functions - Environment Variables Demo
exports.helloEnvVars = (req, res) => {
res.send(`<DOCTYPE html>
<html>
<head>
<title>Google Cloud Functions Environment Variables Test</title>
</head>
<body>
<h1>Google Cloud Functions Environment Variables Test</h1>
<table>
<tr>
<th>NAME</th>
<th>VALUE</th>
</tr>
<tr>
<td>SUCH_SECRET</td>
<td>${process.env.SUCH_SECRET || 'UNKNOWN'}</td>
</tr>
<tr>
<td>MANY_ENCRYPTS</td>
<td>${process.env.MANY_ENCRYPTS || 'UNKNOWN'}</td>
</tr>
<tr>
<td>SO_FINALLY_CAUGHT_UP_WITH_AWS</td>
<td>${process.env.SO_FINALLY_CAUGHT_UP_WITH_AWS || 'UNKNOWN'}</td>
</tr>
</table>
<p><a href="https://github.com/simonprickett/google-cloud-functions-environment-variables" target="_blank">Source code / documentation</a>.</p>
</body>
</html>`
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment