firebase-functions 3.18.0 → 3.18.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -28,21 +28,23 @@ async function handleQuitquitquit(req, res) {
28
28
  }
29
29
  app.get('/__/quitquitquit', handleQuitquitquit);
30
30
  app.post('/__/quitquitquit', handleQuitquitquit);
31
- app.get('/__/stack.yaml', async (req, res) => {
32
- try {
33
- const stack = await (0, loader_1.loadStack)(functionsDir);
34
- res.setHeader('content-type', 'text/yaml');
35
- res.send(JSON.stringify(stack));
36
- }
37
- catch (e) {
38
- res
39
- .status(400)
40
- .send(`Failed to generate manifest from function source: ${e}`);
41
- }
42
- });
31
+ if (process.env.FUNCTIONS_CONTROL_API === 'true') {
32
+ app.get('/__/functions.yaml', async (req, res) => {
33
+ try {
34
+ const stack = await (0, loader_1.loadStack)(functionsDir);
35
+ res.setHeader('content-type', 'text/yaml');
36
+ res.send(JSON.stringify(stack));
37
+ }
38
+ catch (e) {
39
+ res
40
+ .status(400)
41
+ .send(`Failed to generate manifest from function source: ${e}`);
42
+ }
43
+ });
44
+ }
43
45
  let port = 8080;
44
- if (process.env.STACK_CONTROL_API_PORT) {
45
- port = Number.parseInt(process.env.STACK_CONTROL_API_PORT);
46
+ if (process.env.PORT) {
47
+ port = Number.parseInt(process.env.PORT);
46
48
  }
47
49
  console.log('Serving at port', port);
48
50
  server = app.listen(port);
@@ -91,11 +91,10 @@ async function loadStack(functionsDir) {
91
91
  const requiredAPIs = [];
92
92
  const mod = await loadModule(functionsDir);
93
93
  extractStack(mod, endpoints, requiredAPIs);
94
- const stack = {
94
+ return {
95
95
  endpoints,
96
96
  specVersion: 'v1alpha1',
97
97
  requiredAPIs: mergeRequiredAPIs(requiredAPIs),
98
98
  };
99
- return stack;
100
99
  }
101
100
  exports.loadStack = loadStack;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "firebase-functions",
3
- "version": "3.18.0",
3
+ "version": "3.18.1",
4
4
  "description": "Firebase SDK for Cloud Functions",
5
5
  "keywords": [
6
6
  "firebase",