Routing¶
Routing in Bast is very simple and efficient. It follows the routing convention of Laravel and Adonis. A simple example is shown below
from bast import Route
route = Route()
route.get('/', 'ExampleController.index')
Bast Routes support GET
, POST
, PUT
and DELETE
requests.
Routing Methods¶
-
class
bast.route.
Route
[source]¶ Route Class. Appends the URL, Controller Instance and Method to a list instance to be passed on to the server instance
-
Route.
get
(url, controller)[source]¶ Gets the Controller and adds the route, controller and method to the url list for GET request
-
Route.
post
(url, controller)[source]¶ Gets the Controller and adds the route, controller and method to the url list for the POST request
-
Route.
put
(url, controller)[source]¶ Gets the Controller and adds the route, controller and method to the url list for PUT request
-
Route.
delete
(url, controller)[source]¶ Gets the Controller and adds the route, controller and method to the url list for the DELETE request