Crates.io | blockless-web-cgi |
lib.rs | blockless-web-cgi |
version | 0.1.1 |
source | src |
created_at | 2023-06-17 11:04:56.661818 |
updated_at | 2023-06-19 05:31:19.229892 |
description | blockless wasm cgi demo |
homepage | |
repository | https://github.com/blocklessnetwork/blockless-web-cgi |
max_upload_size | |
id | 892832 |
size | 39,639 |
wget https://github.com/blocklessnetwork/blockless-web-cgi/archive/refs/heads/main.zip
Use the follow command you can build the wasi file.
$ make release
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