In this example you are mapping every HTTP request with aGET
method and a path equals to/home
toasync def home()
.
http://docs.vibora.io/
and http://vibora.io/
would hit the same application but return different responses based on the HTTP host header
. Vibora makes it very easy thanks to the hosts
attribute.hosts
attribute for every route, you can group routes using a Blueprint./home
and /home/
for example./home
instead of /home/
/home
then/home/
CacheEngine
.Notice the "skip_hooks" parameter which makes cached responses to skip any listeners/hooks. Sometimes this is useful, often not, use wisely.
StaticHandler
as bellow:All parameters are optional.
Host parameter can be used to only serve static files when the Host header matches this specific host.max_cache_size specifies the amount of memory that Vibora may invest into optimizations.