Wille Server Module
Using Wille Server.
Let’s start by importing Wille server:
>>> import server
Instantiate a server with some customisations:
>>> server = server.Server(services_dir='examples/services', apps_dir=None, server_port=80, quiet=True)
Once services are loaded and everything is otherwise ok, let’s run the server
>>> server.run(background=True)
Now, take a look at your HTTP server, at http://localhost:port/
When finished, press Ctrl+C to kill the server
Wille Server
Register specified app to server Parameters:
path - path to app appname - a name for serving the app urls - List of URLs with corresponding callback classes
Register all apps from specified directory
Resolves apps URL
Resolves server’s public IP
Resolves server’s URL
Start the server Parameters:
background - Run in background? (default=True) multi_thread - Use multithreaded server to serve
multiple concurrent requests (default=True)quiet - Quiet operation - avoids printing to console (default=True)
A stoppable HTTP server
Handle requests in a separate thread.
Map requests according to specified URL patterns
Acquire access to memory datastore If key is specified, retrieves content from that key
Parse input data. Parameters: varname - Get only selected variable (None=get all variables in a dict) default - Default value (returned if variable not found)
Match path against given set of URL+handler tuples
Get an instance of local wille client