Skip to content

Commit 4322782

Browse files
committed
Fix #195
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <[email protected]>
1 parent fd51fbd commit 4322782

File tree

1 file changed

+43
-13
lines changed

1 file changed

+43
-13
lines changed

Diff for: lab3.md

+43-13
Original file line numberDiff line numberDiff line change
@@ -392,37 +392,67 @@ $ faas-cli template store list
392392
$ faas-cli template store list -v
393393
394394
NAME SOURCE DESCRIPTION
395-
csharp openfaas Official C# template
396-
dockerfile openfaas Official Dockerfile template
397-
go openfaas Official Golang template
395+
csharp openfaas Classic C# template
396+
dockerfile openfaas Classic Dockerfile template
397+
go openfaas Classic Golang template
398398
...
399399
```
400400

401401
To get more details you can use the `--verbose` flag, or the `describe` command.
402402

403-
Let's get a template for use with Node.js which is powered by the Express.js framework.
403+
Let's find a Golang template with a HTTP format:
404+
405+
``bash
406+
faas-cli template store list | grep golang
407+
408+
golang-http openfaas Golang HTTP template
409+
golang-middleware openfaas Golang Middleware template
410+
```
411+
412+
Then check out its upstream repository:
404413

405414
```sh
406-
$ faas-cli template store describe node10-express
415+
$ faas-cli template store describe golang-http
407416

408-
Name: node10-express
417+
Name: golang-http
409418
Platform: x86_64
410-
Language: NodeJS
411-
Source: openfaas-incubator
412-
Description: NodeJS 10 Express template
413-
Repository: https://github.com/openfaas-incubator/node10-express-template
419+
Language: Go
420+
Source: openfaas
421+
Description: Golang HTTP template
422+
Repository: https://github.com/openfaas/golang-http-template
414423
Official Template: true
415424
```
416425

417426
Pull the template down:
418427

419428
```sh
420-
$ faas-cli template store pull node10-express
429+
$ faas-cli template store pull golang-http
430+
```
431+
432+
You can now create a function with this template by typing in:
433+
434+
```bash
435+
faas-cli new --lang golang-http NAME
436+
```
437+
438+
To make it easier than having to run `faas-cli template store pull golang-http` for functions, you can append the following to your stack.yml file:
439+
440+
```yaml
441+
configuration:
442+
templates:
443+
- name: golang-http
444+
```
445+
446+
Then run the following instead of specifying the template name:
447+
448+
```bash
449+
$ faas-cli template store pull
421450
```
422451

423-
You can now type in `faas-cli new --lang node10-express`.
452+
See also:
424453

425-
See also: [Function & Template Store](https://github.com/openfaas/store/)
454+
* [OpenFaaS YAML reference guide](https://docs.openfaas.com/reference/yaml/)
455+
* [Function & Template Store](https://github.com/openfaas/store/)
426456

427457
### Variable Substitution in YAML File (optional exercise)
428458

0 commit comments

Comments
 (0)