Maybe you have different domains and you want to host them all with a single Vibora application. So 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.
To avoid repeating the hosts attribute for every route, you can group routes using a Blueprint.
from vibora.blueprints import Blueprint
from vibora.responses import Response
docs = Blueprint(hosts=['docs.vibora.io'])
main = Blueprint(hosts=['vibora.io'])
A common source of headaches in URL routing are ending slashes.
Let's take the path /home and /home/ for example.
In a web environment these are two completely different paths, it's up to the server to interpret those as the same or not.
Vibora has three different strategies to deal with this problem:
Strict. Does nothing. If you map your endpoints ending with
slashes then if you try to access /home instead of /home/
you'll get a 404 response.
Redirect (Default). If you map your route as /home then
Vibora will return a 302 response if someone tries to access /home/
Clone. This one is similar to redirect but instead of a 302 it'll
Caching can be a tremendous ally when handling performance issues. Imagine an API that does a read-only query being hit by 10k requests/sec, this means that you are stressing your database at 10k queries/sec.
If you start caching the response for at least one second you drop from 10k queries/sec to 1 query per second. That's a huge improvement with almost no effort.
Vibora has some internal optimizations to speed-up cached APIs so instead of handling it all by ourselves, you should use the CacheEngine.