commit c4032e7c5794cef10bdbd6865eb67e0133086a03
parent 7c5844739e9632a92d288fb0aa892e75f35ee3a7
Author: Yongbin Kim <iam@yongbin.kim>
Date: Fri, 8 Sep 2023 19:16:01 +0900
Update README
Signed-off-by: Yongbin Kim <iam@yongbin.kim>
Diffstat:
M | README | | | 29 | +++++++++++++++++------------ |
1 file changed, 17 insertions(+), 12 deletions(-)
diff --git a/README b/README
@@ -9,7 +9,9 @@ What is this?
This program is a simple function-as-a-service implementation.
-It receives a HTTP request, and executes your program with the request body as stdin.
+It receives a HTTP request, and executes your program with the request body as
+stdin.
+
The stdout of your program is sent back to the client as HTTP response.
Programs are not executed in a sandbox, so be careful.
@@ -18,21 +20,24 @@ Programs are not executed in a sandbox, so be careful.
How to use
----------------
-1. Write your program in Go.
-2. Build your program and place it to `$(pwd)/.functions/$namespace/$function`
-3. Done! Server will build your program, and run it when it receives a HTTP request.
+1. Write your program in any language you want.
+ (I recommend Go since I provide a utility library - see '/pkg/functions' and
+ example programs in '/examples')
+2. Build your program and place it to `{configs.FuncDir}/$namespace/$function`
+3. Done! The server will serve your function.
-URL format
+URI format
----------------
-You can use the following URL format to call your function.
+You can use the following URI format to call your function.
+(Note that wildcard subdomain is required.)
```
-http://$namespace.domain.tld/$function
+{http|https}://{namespace}.{configs.RootDomain}/{function}
```
-This is not optional, so, you must set wildcard DNS record to your domain.
+This will call `{configs.FuncDir}/$namespace/$function`.
To test on your local machine, you can use this command:
@@ -41,7 +46,7 @@ curl --resolve '*:8080:127.0.0.1' http://example.domain.tld:8080/helloworld
```
-Why?
+Why you made this?
----------------
Because it's fun.
@@ -52,8 +57,8 @@ License
(c) Yongbin Kim
-Utilization of the works is permitted provided that this
-instrument is retained with the works, so that any entity
-that utilizes the works is notified of this instrument.
+Utilization of the works is permitted provided that this instrument is retained
+with the works, so that any entity that utilizes the works is notified of this
+instrument.
DISCLAIMER: THE WORKS ARE WITHOUT WARRANTY.