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: docs/architecture/invocations.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,11 +22,11 @@ Whenever you run `faas-cli build` or `faas-cli publish` using one of the OpenFaa
22
22
Templates tend to abstract away the Dockerfile and entry-point HTTP server from you, so that you can focus on writing a HTTP or function handler, they are still there however and you can look into the "template" folder to find them after running `faas-cli template store pull`
Copy file name to clipboardExpand all lines: docs/cli/build.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -152,8 +152,8 @@ Create a function:
152
152
153
153
```bash
154
154
export OPENFAAS_PREFIX=openfaasltd
155
-
faas-cli template store pull node20
156
-
faas-cli new --lang node20 withprivatenpm
155
+
faas-cli template store pull node22
156
+
faas-cli new --lang node22 withprivatenpm
157
157
```
158
158
159
159
You will need to create an authentication token to install private npm modules. These instructions will differ depending on the registry you want to use:
@@ -186,7 +186,7 @@ provider:
186
186
gateway: http://127.0.0.1:8080
187
187
functions:
188
188
withprivatenpm:
189
-
lang: node20
189
+
lang: node22
190
190
handler: ./withprivatenpm
191
191
image: openfaasltd/withprivatenpm:latest
192
192
build_secrets:
@@ -199,7 +199,7 @@ Run a build with:
199
199
faas-cli pro build -f stack.yml
200
200
```
201
201
202
-
You'll also need an updated version of the node template to mount the secret passed in from the OpenFaaS Pro plugin. Update `template/node20/Dockerfile` and replace the second `npm i` command with:
202
+
You'll also need an updated version of the node template to mount the secret passed in from the OpenFaaS Pro plugin. Update `template/node22/Dockerfile` and replace the second `npm i` command with:
203
203
204
204
```Dockerfile
205
205
RUN --mount=type=secret,id=npmrc,mode=0666,dst=/home/app/.npmrc npm i
Copy file name to clipboardExpand all lines: docs/languages/custom.md
+4-9Lines changed: 4 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,7 +30,7 @@ This will include code submitted by a third party. It may or may not be kept up
30
30
31
31
### Make your own template
32
32
33
-
The easiest way to write a template for OpenFaaS it to copy an official template, and to modify it. This example creates a template using Bun and Express.js which is based upon the official node20 template.
33
+
The easiest way to write a template for OpenFaaS it to copy an official template, and to modify it. This example creates a template using Bun and Express.js which is based upon the official 22 template.
34
34
35
35
Create a new folder called my-templates, it should have a sub-directory within it called `template`.
36
36
@@ -57,12 +57,12 @@ Next, create a Dockerfile which should download and make available the OpenFaaS
57
57
58
58
There are two watchdogs available, the [Classic Watchdog](https://github.com/openfaas/classic-watchdog), meant for processes which do not have their own HTTP server, the process will be forked for each request, and the [of-watchdog](https://github.com/openfaas/of-watchdog) for when a HTTP server is available. Since Bun used with Express.js provides a HTTP server, we'll be using the of-watchdog.
59
59
60
-
The following Dockerfile is based upon the node20 template, adapted for Bun.
60
+
The following Dockerfile is based upon the node22 template, adapted for Bun.
61
61
62
62
The `--platform=${TARGETPLATFORM:-linux/amd64}` directive is required for multi-arch support, to make the template work for 64-bit Arm as well as regular *x86_64* machines. Most images that you find on the Docker Hub will already have multi-arch support, and it's strongly recommended to keep it in place.
63
63
64
64
```Dockerfile
65
-
FROM --platform=${TARGETPLATFORM:-linux/amd64} ghcr.io/openfaas/of-watchdog:0.9.11 as watchdog
65
+
FROM --platform=${TARGETPLATFORM:-linux/amd64} ghcr.io/openfaas/of-watchdog:0.10.9 as watchdog
66
66
FROM --platform=${TARGETPLATFORM:-linux/amd64} oven/bun:alpine as ship
Copy file name to clipboardExpand all lines: docs/languages/node.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ The [Node.js](https://nodejs.org/en) template for OpenFaaS uses [Express.js](htt
4
4
5
5
!!! info "Do you need to customise this template?"
6
6
7
-
You can customise the official templates, or provide your own. The code for this templates is available on GitHub: [openfaas/templates](https://github.com/openfaas/templates/tree/master/template/node20).
7
+
You can customise the official templates, or provide your own. The code for this templates is available on GitHub: [openfaas/templates](https://github.com/openfaas/templates/tree/master/template/node22).
8
8
9
9
The event is used to obtain the original HTTP request, and the context is used to set the HTTP response. The underlying Express.js object is an implementation detail, and so is not available to the function author.
10
10
@@ -20,7 +20,7 @@ Create a new function using the template:
20
20
21
21
```bash
22
22
faas-cli template pull
23
-
faas-cli new --lang node20echo
23
+
faas-cli new --lang node22echo
24
24
```
25
25
26
26
You'll find a new folder called `echo` with a `handler.js` and `package.json` file inside.
@@ -68,7 +68,7 @@ Or to combine the `context.status()` method with the `context.succeed()` method
68
68
To install packages, `cd` into the function folder and run `npm install --save`:
69
69
70
70
```bash
71
-
faas-cli new --lang node20 http-req
71
+
faas-cli new --lang node22 http-req
72
72
cd http-req
73
73
74
74
npm install --save axios
@@ -132,12 +132,12 @@ Then create a new secret in OpenFaaS:
Create a new function using the *node20* template:
135
+
Create a new function using the *node22* template:
136
136
137
137
```bash
138
138
export OPENFAAS_PREFIX=ttl.sh/fns
139
139
140
-
faas-cli new --lang node20 node-fn
140
+
faas-cli new --lang node22 node-fn
141
141
```
142
142
143
143
Then edit the `node-fn/handler.js`:
@@ -176,7 +176,7 @@ Edit `node-fn.yml` and add the `secrets` section:
176
176
```diff
177
177
functions:
178
178
node-fn:
179
-
lang: node20
179
+
lang: node22
180
180
handler: ./node-fn
181
181
image: ttl.sh/fns/node-fn:latest
182
182
+ secrets:
@@ -210,7 +210,7 @@ When you test the function with `faas-cli up`, make sure you use the function's
210
210
211
211
Unit tests provide a quick and efficient way to exercise your code on your local computer, without needing to run `faas-cli build` or to deploy the function to a remote cluster.
212
212
213
-
With the node20 template, any unit tests that you provide will be run automatically upon each invocation of `faas-cli build`.
213
+
With the node22 template, any unit tests that you provide will be run automatically upon each invocation of `faas-cli build`.
214
214
215
215
216
216
By default, an empty test step is written to package.json inside your function's handler folder, you can override this with your own command or test runner.
@@ -305,7 +305,7 @@ The OpenTelemetry agent can be configured using environment variables on the fun
0 commit comments