def uri(request):
    """Gets the URI for the application."""
    if request.app['https']:
        return 'https://' + request.headers['Host']
    else:
        return 'http://' + request.headers['Host']