Setting Up the Routes

For this functionality, we'll need to add two routes to display the article creation page and process the article creation request.

This would be a good time to group the article related routes together in routes.go as follows:

// routes.go

    articleRoutes := router.Group("/article")
    {
        // route from Part 1 of the tutorial
        articleRoutes.GET("/view/:article_id", getArticle)

        articleRoutes.GET("/create", showArticleCreationPage)

        articleRoutes.POST("/create", createArticle)
    }

results matching ""

    No results matching ""