mirror of
https://github.com/openfaas/faas.git
synced 2025-06-14 19:26:48 +00:00
Change the node example in readme to node12
Signed-off-by: Alistair Hey <alistair@heyal.co.uk>
This commit is contained in:
parent
250b3fccda
commit
09b867559d
12
README.md
12
README.md
@ -95,21 +95,21 @@ You can generate new functions using the `faas-cli` and built-in templates or us
|
|||||||
|
|
||||||
Official templates exist for many popular languages and are easily extensible with Dockerfiles.
|
Official templates exist for many popular languages and are easily extensible with Dockerfiles.
|
||||||
|
|
||||||
* Node.js (`node10-express`) example:
|
* Node.js (`node12`) example:
|
||||||
|
|
||||||
```js
|
```js
|
||||||
"use strict"
|
"use strict"
|
||||||
|
|
||||||
module.exports = (event, context) => {
|
module.exports = async (event, context) => {
|
||||||
|
return context
|
||||||
context
|
|
||||||
.headers({"Content-Type": "text/html"})
|
|
||||||
.status(200)
|
.status(200)
|
||||||
|
.headers({"Content-Type": "text/html"})
|
||||||
.succeed(`
|
.succeed(`
|
||||||
<h1>
|
<h1>
|
||||||
👋 Hello World 🌍
|
👋 Hello World 🌍
|
||||||
</h1>`)
|
</h1>`);
|
||||||
}
|
}
|
||||||
|
|
||||||
```
|
```
|
||||||
*handler.js*
|
*handler.js*
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user