Server Configuration
Customize the server host, port, and template directory.
Basic Usage
from func_to_web import run
def my_function(x: int):
return x * 2
# Single function
run(my_function, host="127.0.0.1", port=5000)
# Multiple functions
run([func1, func2], host="127.0.0.1", port=5000, template_dir="my_templates")
Parameters
func_or_list- Single function or list of functions to servehost- Server host (default:"0.0.0.0")port- Server port (default:8000)template_dir- Custom template directory (optional)
Common Configurations
Localhost only:
Custom port:
Network accessible (default):
Custom templates:
That's It!
You've completed the func-to-web documentation. Check out the examples folder for 20+ complete, runnable examples.