You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: readme.md
+20-21Lines changed: 20 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,11 +2,9 @@
2
2
3
3
## Getting Started
4
4
5
-
To begin you will need `nodejs` and `firebase-tools`
5
+
This documentation describes features of the `firebase-framework` but generally does not cover firebase options in general. For example, to find out how you can specify a specific version of nodejs see the firebase docs here: https://firebase.google.com/docs/functions/manage-functions#set_nodejs_version
6
6
7
-
nodejs v8.15.x is recommended because cloud functions by default uses node 8. \
8
-
While it is not the most recent LTS build it can be downloaded here:
9
-
<https://nodejs.org/download/release/v8.15.1/>
7
+
To begin you will need `nodejs` and `firebase-tools`
| resourcePath | false | string | defines which documents in the db should be published when changed ex: `'posts/{id}'` (uses the cloud functions firestore triggers syntax) |
113
-
| schema | false | object | should contain a reference to the `require`d schema file |
114
-
| postSchema | false | object | optional alternative used for services that require special fields during creation |
115
-
| publishChanges | false | boolean | whether the service should publish changes to it's data as messages on cloud pub sub |
116
-
| withModifiers | false | boolean | declares that the schema can contain `writeModifier` keys that define a function that will modify values before they are processes/saved |
117
-
| middleware | false | Array | ExpressJs middleware that will apply to all routes in the service |
118
-
| routes | false | Array | these are the functions triggered within the service by http requests (see routes below) |
119
-
| events | false | Array | pub sub events that the service will listed to (see events below) |
120
-
| schedule | false | Array | cloud schedules that will trigger functions within this service (see schedule below) |
121
-
| keepAlive | false | boolean | whether a scheduled function should be set up that will trigger the http function (routes) every 5 minutes to prevent cold starts\*|
122
-
| runtimeOptions | false | object | An object containing 2 optional properties. `memory`: amount of memory to allocate to the function, possible values are: '128MB', '256MB', '512MB', '1GB', and '2GB'. `timeoutSeconds`: timeout for the function in seconds, possible values are 0 to 540. |
| resourcePath | false | string | defines which documents in the db should be published when changed ex: `'posts/{id}'` (uses the cloud functions firestore triggers syntax) |
111
+
| schema | false | object | should contain a reference to the `require`d schema file |
112
+
| postSchema | false | object | optional alternative used for services that require special fields during creation |
113
+
| publishChanges | false | boolean | whether the service should publish changes to it's data as messages on cloud pub sub |
114
+
| withModifiers | false | boolean | declares that the schema can contain `writeModifier` keys that define a function that will modify values before they are processes/saved |
115
+
| middleware | false | Array | ExpressJs middleware that will apply to all routes in the service |
116
+
| routes | false | Array | these are the functions triggered within the service by http requests (see routes below) |
117
+
| events | false | Array | pub sub events that the service will listed to (see events below) |
118
+
| schedule | false | Array | cloud schedules that will trigger functions within this service (see schedule below) |
119
+
| keepAlive | false | boolean | whether a scheduled function should be set up that will trigger the http function (routes) every 5 minutes to prevent cold starts\*|
120
+
| runtimeOptions | false | object | Firebase runtime options usually passed to `runWith` as documented here: https://firebase.google.com/docs/reference/functions/function_configuration.runtimeoptions|
121
+
| maxAge | undefined | number | The maxAge in ms before the event listener will not attempt to process an event. Can be used to prevent infinite retries of a retry-able event |
123
122
124
123
\* Though billing is required, you can expect the overall cost to be manageable, as each Cloud Scheduler job costs \$0.10 (USD) per month, and there is an allowance of three free jobs per Google account (as of the time of writing). \* The keepAlive feature adds a route to the service at '/heartbeat'. This will not conflict with wildcard routes in the service but would conflict with a route named the same.
125
124
@@ -142,7 +141,7 @@ module.exports = [hello];
142
141
| type | false | string | the event type to listen to. This is passed to the subscriber but will not affect which message in the topic trigger the subscriber, it can function as a not about which types of events from the topic the function cares about |
143
142
| function | false | function | to be executed when the described event is triggered |
144
143
| ensureIdempotent | false | boolean | whether the framework should check messages against a store (requires a firestore database in the project) to ensure that messages are never processed more than once |
145
-
| runtimeOptions | false | object |An object containing 2 optional properties. `memory`: amount of memory to allocate to the function, possible values are: '128MB', '256MB', '512MB', '1GB', and '2GB'. `timeoutSeconds`: timeout for the function in seconds, possible values are 0 to 540.|
144
+
| runtimeOptions | false | object |Firebase runtime options usually passed to `runWith` as documented here: https://firebase.google.com/docs/reference/functions/function_configuration.runtimeoptions|
146
145
147
146
#### Schedule
148
147
@@ -151,7 +150,7 @@ module.exports = [hello];
151
150
| name | true | string | The name of the schedule (it can be anything) |
152
151
| time | true | string | Both Unix Crontab and AppEngine syntax are supported by Google Cloud Scheduler. |
153
152
| function | false | function | to be executed when the cronjob is run |
154
-
| runtimeOptions | false | object |An object containing 2 optional properties. `memory`: amount of memory to allocate to the function, possible values are: '128MB', '256MB', '512MB', '1GB', and '2GB'. `timeoutSeconds`: timeout for the function in seconds, possible values are 0 to 540.|
153
+
| runtimeOptions | false | object |Firebase runtime options usually passed to `runWith` as documented here: https://firebase.google.com/docs/reference/functions/function_configuration.runtimeoptions|
0 commit comments