-
Notifications
You must be signed in to change notification settings - Fork 206
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Firebase Functions ships with a binary (#1003)
We introduce a bin associated with the firebase-functions SDK! The binary exposes a simple server on localhost that describes the Firebase Functions defined in the current directory: ``` $ STACK_CONTROL_API_PORT=8181 npx firebase-functions # Optionally can pass in a FUNCTIONS_DIR as first arg Serving at port 8181 $ curl localhost:8181/__/stack.yaml | jq { "endpoints": { "onreqv2": { "platform": "gcfv2", "labels": {}, "httpsTrigger": {}, "entryPoint": "onreqv2" }, "onRequest": { "platform": "gcfv1", "httpsTrigger": {}, "entryPoint": "onRequest" } }, "specVersion": "v1alpha1", "requiredAPIs": [] } ```
- Loading branch information
Showing
29 changed files
with
872 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
const functions = require("../../../../src/index"); | ||
|
||
exports.groupedhttp = functions.https.onRequest((req, resp) => { | ||
resp.status(200).send("PASS"); | ||
}); | ||
|
||
exports.groupedcallable = functions.https.onCall(() => { | ||
return "PASS"; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
const functions = require("../../../../src/index"); | ||
const functionsv2 = require("../../../../src/v2/index"); | ||
|
||
exports.v1http = functions.https.onRequest((req, resp) => { | ||
resp.status(200).send("PASS"); | ||
}); | ||
|
||
exports.v1callable = functions.https.onCall(() => { | ||
return "PASS"; | ||
}); | ||
|
||
exports.v2http = functionsv2.https.onRequest((req, resp) => { | ||
resp.status(200).send("PASS"); | ||
}); | ||
|
||
exports.v2callable = functionsv2.https.onCall(() => { | ||
return "PASS"; | ||
}); | ||
|
||
exports.g1 = require("./g1"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"name": "commonjs-grouped" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
const functions = require("../../../../src/index"); | ||
const functionsv2 = require("../../../../src/v2/index"); | ||
|
||
exports.v1http = functions.https.onRequest((req, resp) => { | ||
resp.status(200).send("PASS"); | ||
}); | ||
|
||
exports.v1callable = functions.https.onCall(() => { | ||
return "PASS"; | ||
}); | ||
|
||
exports.v2http = functionsv2.https.onRequest((req, resp) => { | ||
resp.status(200).send("PASS"); | ||
}); | ||
|
||
exports.v2callable = functionsv2.https.onCall(() => { | ||
return "PASS"; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"name": "commonjs-main", | ||
"main": "functions.js" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
const functions = require("../../../../src/index"); | ||
const functionsv2 = require("../../../../src/v2/index"); | ||
|
||
exports.v1http = functions.https.onRequest((req, resp) => { | ||
resp.status(200).send("PASS"); | ||
}); | ||
|
||
exports.v1callable = functions.https.onCall(() => { | ||
return "PASS"; | ||
}); | ||
|
||
exports.v2http = functionsv2.https.onRequest((req, resp) => { | ||
resp.status(200).send("PASS"); | ||
}); | ||
|
||
exports.v2callable = functionsv2.https.onCall(() => { | ||
return "PASS"; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"name": "commonjs" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import * as functions from '../../../../lib/index.js'; | ||
import * as functionsv2 from "../../../../lib/v2/index.js"; | ||
|
||
export const v1http = functions.https.onRequest((req, resp) => { | ||
resp.status(200).send("PASS"); | ||
}); | ||
|
||
export const v1callable = functions.https.onCall(() => { | ||
return "PASS"; | ||
}); | ||
|
||
export const v2http = functionsv2.https.onRequest((req, resp) => { | ||
resp.status(200).send("PASS"); | ||
}); | ||
|
||
export const v2callable = functionsv2.https.onCall(() => { | ||
return "PASS"; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"name": "esm-ext", | ||
"main": "index.mjs" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import * as functions from "../../../../lib/index.js"; | ||
import * as functionsv2 from "../../../../lib/v2/index.js"; | ||
|
||
export const v1http = functions.https.onRequest((req, resp) => { | ||
resp.status(200).send("PASS"); | ||
}); | ||
|
||
export const v1callable = functions.https.onCall(() => { | ||
return "PASS"; | ||
}); | ||
|
||
export const v2http = functionsv2.https.onRequest((req, resp) => { | ||
resp.status(200).send("PASS"); | ||
}); | ||
|
||
export const v2callable = functionsv2.https.onCall(() => { | ||
return "PASS"; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"name": "esm-main", | ||
"main": "functions.js", | ||
"type": "module" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import * as functions from "../../../../lib/index.js"; | ||
import * as functionsv2 from "../../../../lib/v2/index.js"; | ||
|
||
export const v1http = functions.https.onRequest((req, resp) => { | ||
resp.status(200).send("PASS"); | ||
}); | ||
|
||
export const v1callable = functions.https.onCall(() => { | ||
return "PASS"; | ||
}); | ||
|
||
export const v2http = functionsv2.https.onRequest((req, resp) => { | ||
resp.status(200).send("PASS"); | ||
}); | ||
|
||
export const v2callable = functionsv2.https.onCall(() => { | ||
return "PASS"; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"name": "esm", | ||
"type": "module" | ||
} |
Oops, something went wrong.