# Run the Fluor Server
cargo run --release > /dev/null 2>&1 &
# Go to example directory
cd examples/rust
# Create a compressed archive from project directory
# -- "hello/" is a project directory
tar -czvf source.tar.gz -C hello/ .
# Create a new function (hello-rust)
JSON=$(cat <<EOF
{
"name": "hello-rust",
"language": "rust",
"source": "$(base64 -w 0 source.tar.gz)",
"method": "GET",
"path": "/hello-rust/",
"cpu": "2",
"memory": "512m",
"uptime": "30"
}
EOF
)
curl -X POST -H "Content-Type:application/json" -d "$JSON" "http://localhost:8000/function/"
# Invoke the function
curl -X GET "http://localhost:8000/hello-rust/"
# Delete the function
curl -X DELETE -H "Content-Type:application/json" -d "$JSON" "http://localhost:8000/function/"
# Stop the Fluor Server
killall -9 fluor
Contributions in the form of bug reports, feature requests, or pull requests are welcome.
Fluor Functions is licensed under the MIT License