mirror of
https://github.com/openshift/openshift-docs.git
synced 2026-02-05 12:46:18 +01:00
34 lines
849 B
Plaintext
34 lines
849 B
Plaintext
[id="serverless-create-func-kn_{context}"]
|
|
= Creating functions
|
|
|
|
You can create a basic serverless function using the `kn` CLI.
|
|
|
|
You can specify the path, runtime, and template as flags on the command line, or use the `-c` flag to start the interactive experience in the terminal.
|
|
|
|
.Procedure
|
|
|
|
* Create a function project:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ kn func create <path> -l <runtime> -t <template>
|
|
----
|
|
** Supported runtimes include `node`, `go`, `python`, `quarkus`, and `typescript`.
|
|
** Supported templates include `http` and `events`.
|
|
+
|
|
.Example command
|
|
[source,terminal]
|
|
----
|
|
$ kn func create -l typescript -t events examplefunc
|
|
----
|
|
+
|
|
.Example output
|
|
[source,terminal]
|
|
----
|
|
Project path: /home/user/demo/examplefunc
|
|
Function name: examplefunc
|
|
Runtime: typescript
|
|
Template: events
|
|
Writing events to /home/user/demo/examplefunc
|
|
----
|