def remount(base):
    if not base: # no remount needed
        return bottle.app()
    oldApp = bottle.app.pop() # remove current app
    newApp = bottle.app.push() # create new app
    newApp.mount(base, oldApp) # remount old on new path
    return newApp
Remount current app to new app at base mountpoint such as '/demo'
dataset/ETHPy150Open saltstack/halite/halite/server_bottle.py/remount