forked from jason/cpolis
restructure routes
This commit is contained in:
60
cmd/main.go
60
cmd/main.go
@ -49,42 +49,42 @@ func main() {
|
||||
http.FileServer(http.Dir(config.WebDir+"/static/"))))
|
||||
mux.HandleFunc("/", f.HomePage(config, db, store))
|
||||
|
||||
mux.HandleFunc("GET /article/all-published", f.ShowPublishedArticles(config, db, store))
|
||||
mux.HandleFunc("GET /article/all-rejected", f.ShowRejectedArticles(config, db, store))
|
||||
mux.HandleFunc("GET /article/all-unpublished", f.ShowUnpublishedArticles(config, db, store))
|
||||
mux.HandleFunc("GET /article/delete/{id}", f.DeleteArticle(config, db, store))
|
||||
mux.HandleFunc("GET /article/publish/{id}", f.PublishArticle(config, db, store))
|
||||
mux.HandleFunc("GET /article/reject/{id}", f.RejectArticle(config, db, store))
|
||||
mux.HandleFunc("GET /article/review-deletion/{id}", f.ReviewArticleForDeletion(config, db, store))
|
||||
mux.HandleFunc("GET /article/review-rejected/{id}", f.ReviewRejectedArticle(config, db, store))
|
||||
mux.HandleFunc("GET /article/review-unpublished/{id}", f.ReviewUnpublishedArticle(config, db, store))
|
||||
mux.HandleFunc("GET /article/serve/{id}", c.ServeArticle(config, db))
|
||||
mux.HandleFunc("GET /create-tag", f.CreateTag(config, store))
|
||||
mux.HandleFunc("GET /create-user", f.CreateUser(config, store))
|
||||
mux.HandleFunc("GET /delete-article/{id}", f.DeleteArticle(config, db, store))
|
||||
mux.HandleFunc("GET /delete-user/{id}", f.DeleteUser(config, db, store))
|
||||
mux.HandleFunc("GET /edit-self", f.EditSelf(config, db, store))
|
||||
mux.HandleFunc("GET /edit-user/{id}", f.EditUser(config, db, store))
|
||||
mux.HandleFunc("GET /article/write", f.WriteArticle(config, db, store))
|
||||
mux.HandleFunc("GET /hub", f.ShowHub(config, db, store))
|
||||
mux.HandleFunc("GET /issue/publish", f.PublishLatestIssue(config, db, store))
|
||||
mux.HandleFunc("GET /issue/this", f.ShowCurrentArticles(config, db, store))
|
||||
mux.HandleFunc("GET /logout", f.Logout(config, store))
|
||||
mux.HandleFunc("GET /pdf/get-list", c.ServePDFList(config))
|
||||
mux.HandleFunc("GET /pdf/{id}", c.ServePDF(config))
|
||||
mux.HandleFunc("GET /pics/{pic}", f.ServeImage(config, store))
|
||||
mux.HandleFunc("GET /publish-article/{id}", f.PublishArticle(config, db, store))
|
||||
mux.HandleFunc("GET /publish-issue", f.PublishLatestIssue(config, db, store))
|
||||
mux.HandleFunc("GET /published-articles", f.ShowPublishedArticles(config, db, store))
|
||||
mux.HandleFunc("GET /reject-article/{id}", f.RejectArticle(config, db, store))
|
||||
mux.HandleFunc("GET /rejected-articles", f.ShowRejectedArticles(config, db, store))
|
||||
mux.HandleFunc("GET /review-article-for-deletion/{id}", f.ReviewArticleForDeletion(config, db, store))
|
||||
mux.HandleFunc("GET /review-rejected-article/{id}", f.ReviewRejectedArticle(config, db, store))
|
||||
mux.HandleFunc("GET /review-unpublished-article/{id}", f.ReviewUnpublishedArticle(config, db, store))
|
||||
mux.HandleFunc("GET /rss", c.ServeRSS(config))
|
||||
mux.HandleFunc("GET /show-all-users-edit", f.ShowAllUsers(config, db, store, "edit-user"))
|
||||
mux.HandleFunc("GET /show-all-users-delete", f.ShowAllUsers(config, db, store, "delete-user"))
|
||||
mux.HandleFunc("GET /this-issue", f.ShowCurrentArticles(config, db, store))
|
||||
mux.HandleFunc("GET /unpublished-articles", f.ShowUnpublishedArticles(config, db, store))
|
||||
mux.HandleFunc("GET /write-article", f.WriteArticle(config, db, store))
|
||||
mux.HandleFunc("GET /pdf/serve/{id}", c.ServePDF(config))
|
||||
mux.HandleFunc("GET /pic/serve/{pic}", f.ServeImage(config, store))
|
||||
mux.HandleFunc("GET /rss/serve", c.ServeRSS(config))
|
||||
mux.HandleFunc("GET /tag/create", f.CreateTag(config, store))
|
||||
mux.HandleFunc("GET /user/create", f.CreateUser(config, store))
|
||||
mux.HandleFunc("GET /user/delete/{id}", f.DeleteUser(config, db, store))
|
||||
mux.HandleFunc("GET /user/edit/{id}", f.EditUser(config, db, store))
|
||||
mux.HandleFunc("GET /user/edit/self", f.EditSelf(config, db, store))
|
||||
mux.HandleFunc("GET /user/show-all/delete", f.ShowAllUsers(config, db, store, "delete-user"))
|
||||
mux.HandleFunc("GET /user/show-all/edit", f.ShowAllUsers(config, db, store, "edit-user"))
|
||||
|
||||
mux.HandleFunc("POST /add-first-user", f.AddFirstUser(config, db, store))
|
||||
mux.HandleFunc("POST /add-tag", f.AddTag(config, db, store))
|
||||
mux.HandleFunc("POST /add-user", f.AddUser(config, db, store))
|
||||
mux.HandleFunc("POST /article/resubmit/{id}", f.ResubmitArticle(config, db, store))
|
||||
mux.HandleFunc("POST /article/submit", f.SubmitArticle(config, db, store))
|
||||
mux.HandleFunc("POST /login", f.Login(config, db, store))
|
||||
mux.HandleFunc("POST /resubmit-article/{id}", f.ResubmitArticle(config, db, store))
|
||||
mux.HandleFunc("POST /submit-article", f.SubmitArticle(config, db, store))
|
||||
mux.HandleFunc("POST /update-self", f.UpdateSelf(config, db, store))
|
||||
mux.HandleFunc("POST /update-user/{id}", f.UpdateUser(config, db, store))
|
||||
mux.HandleFunc("POST /upload-image", f.UploadImage(config, store))
|
||||
mux.HandleFunc("POST /pic/upload", f.UploadImage(config, store))
|
||||
mux.HandleFunc("POST /tag/add", f.AddTag(config, db, store))
|
||||
mux.HandleFunc("POST /user/add", f.AddUser(config, db, store))
|
||||
mux.HandleFunc("POST /user/add-first", f.AddFirstUser(config, db, store))
|
||||
mux.HandleFunc("POST /user/update/{id}", f.UpdateUser(config, db, store))
|
||||
mux.HandleFunc("POST /user/update/self", f.UpdateSelf(config, db, store))
|
||||
|
||||
log.Fatalln(http.ListenAndServe(config.Port, mux))
|
||||
}
|
||||
|
Reference in New Issue
Block a user