Mount an application (:class:`Bottle` or plain WSGI) to a specific URL prefix. Example:: parent_app.mount('/prefix/', child_app) :param prefix: path prefix or `mount-point`. :param app: an instance of :class:`Bottle` or a WSGI application.
(self, prefix, app, **options)
| 760 | self.add_route(route) |
| 761 | |
| 762 | def mount(self, prefix, app, **options): |
| 763 | """ Mount an application (:class:`Bottle` or plain WSGI) to a specific |
| 764 | URL prefix. Example:: |
| 765 | |
| 766 | parent_app.mount('/prefix/', child_app) |
| 767 | |
| 768 | :param prefix: path prefix or `mount-point`. |
| 769 | :param app: an instance of :class:`Bottle` or a WSGI application. |
| 770 | |
| 771 | Plugins from the parent application are not applied to the routes |
| 772 | of the mounted child application. If you need plugins in the child |
| 773 | application, install them separately. |
| 774 | |
| 775 | While it is possible to use path wildcards within the prefix path |
| 776 | (:class:`Bottle` childs only), it is highly discouraged. |
| 777 | |
| 778 | The prefix path must end with a slash. If you want to access the |
| 779 | root of the child application via `/prefix` in addition to |
| 780 | `/prefix/`, consider adding a route with a 307 redirect to the |
| 781 | parent application. |
| 782 | """ |
| 783 | |
| 784 | if not prefix.startswith('/'): |
| 785 | raise ValueError("Prefix must start with '/'") |
| 786 | |
| 787 | if isinstance(app, Bottle): |
| 788 | return self._mount_app(prefix, app, **options) |
| 789 | else: |
| 790 | return self._mount_wsgi(prefix, app, **options) |
| 791 | |
| 792 | def merge(self, routes): |
| 793 | """ Merge the routes of another :class:`Bottle` application or a list of |
nothing calls this directly
no test coverage detected