def setUp(self):
     super().setUp()
     self.setRoutes(
         Route.get("home", "TestController@show").name("home"),
         Route.get("posts", "TestController@show").name("posts.index"),
         Route.get("posts/@post", "TestController@show").name("posts.show"),
         Route.get("posts/@post/comments", "TestController@show").name("postComments.index"),
         Route.get("posts/@post/comments/@comment:int", "TestController@show").name(
             "postComments.show"
         ),
         Route.post("posts", "TestController@show").name("posts.store"),
         Route.get("admin/users", "TestController@show").name("admin.users.index"),
     )
 def setUp(self):
     super().setUp()
     self.setRoutes(
         Route.get("home", "TestController@show").name("home"),
         Route.get("posts", "TestController@show").name("posts.index"),
         Route.get("posts/@post", "TestController@show").name("posts.show"),
         Route.get("posts/@post/comments",
                   "TestController@show").name("postComments.index"),
         Route.get("posts/@post/comments/@comment:int",
                   "TestController@show").name("postComments.show"),
         Route.post("posts", "TestController@show").name("posts.store"),
         Route.get("admin/users",
                   "TestController@show").name("admin.users.index"),
     )
     self.original_config = {
         "filters": {
             "only": [],
             "except": [],
             "groups": {}
         },
         "skip_route_function": False,
     }
예제 #3
0
from masonite.routes import Route

ROUTES = [
    Route.get("/", "UserController@index"),
    Route.get("/user/@id:int", "UserController@show"),
    Route.post("/user", "UserController@create"),
]
예제 #4
0
파일: web.py 프로젝트: smgueye/blog
from masonite.authentication import Auth
from masonite.routes import Route

ROUTES = [
    Route.get("/", "HomeController@show"),

    # Blog Routes
    Route.get("/blog", "BlogController@show"),
    Route.get("/blog/new", "BlogController@new"),
    Route.post("/blog/create", "BlogController@create"),
    Route.get("/blog/@slug", "BlogController@detail"),
    Route.get("/blog/edit/@id", "BlogController@edit"),
    Route.post("/blog/update/@id", "BlogController@update"),
    Route.get("/blog/@id/delete", "BlogController@delete"),
]

ROUTES += Auth.routes()
예제 #5
0
""" Web Routes """
from masonite.routes import Route

ROUTES = [
    Route.get("/", "WelcomeController@show").name("home"),
    Route.get("posts", "WelcomeController@posts").name("posts.index"),
    Route.post("posts", "WelcomeController@create_post").name("posts.create"),
    # Route.match(["get", "post"], "posts", "WelcomeController@posts").name("posts"),
    Route.get("posts/@id", "WelcomeController@show_post").name("posts.show"),
    Route.get(
        "posts/@post_id/comments/@id",
        "WelcomeController@show_post_comments").name("posts.comments.show"),
]