blockless-web-cgi

Crates.ioblockless-web-cgi
lib.rsblockless-web-cgi
version0.1.1
sourcesrc
created_at2023-06-17 11:04:56.661818
updated_at2023-06-19 05:31:19.229892
descriptionblockless wasm cgi demo
homepage
repositoryhttps://github.com/blocklessnetwork/blockless-web-cgi
max_upload_size
id892832
size39,639
Join.Gong (Joinhack)

documentation

README

blockless-web-cgi is the demo project to show how the cgi work.

How to get the template project.

wget https://github.com/blocklessnetwork/blockless-web-cgi/archive/refs/heads/main.zip

How to build.

Use the follow command you can build the wasi file.

$ make release

How to run.

Download the blockless runtime. https://github.com/blocklessnetwork/runtime/releases

Modify the cgi script cgi-web

#### this is security for cgi plugin
opts, args = getopt.getopt(sys.argv[1:], '', ['ext_verify'])
verify = {"alias": "cgi-web","description": "this is cgi-web test","is_cgi": True}
is_verify = False
for o, a in opts:
    if o in ('--ext_verify'):
        is_verify = True

if is_verify:
    print(json.dumps(verify))
    sys.exit(0)
#### this is security for cgi plugin#####

print("web-cgi: hello world")

Now you can start the server and browse to http://localhost:8000/ to see it in action:

$ blockless-cli blockless-web-cgi.wasm - --drivers-root-path=$DIRECTORY_OF_CGI_WEB
Commit count: 13

cargo fmt