Skip to content
This repository was archived by the owner on Apr 23, 2024. It is now read-only.

Latest commit

 

History

History
44 lines (31 loc) · 836 Bytes

integration.md

File metadata and controls

44 lines (31 loc) · 836 Bytes

Integrate with WEB frameworks

QOR Admin should be able to integrate with most golang web frameworks (let me know if there are any web framework not supported), here are some examples of how to integrate with them.

Integrate with HTTP ServeMux

mux := http.NewServeMux()
Admin.MountTo("/admin", mux)
http.ListenAndServe(":9000", mux)

Integrate with Beego

mux := http.NewServeMux()
Admin.MountTo("/admin", mux)

beego.Handler("/admin/*", mux)
beego.Run()

Integrate with Gin

mux := http.NewServeMux()
Admin.MountTo("/admin", mux)

r := gin.Default()
r.Any("/admin/*resources", gin.WrapH(mux))
r.Run()

Integrate with gorilla/mux

adminMux := http.NewServeMux()
Admin.MountTo("/admin", adminMux)

r := mux.NewRouter()
r.PathPrefix("/admin").Handler(adminMux)

http.Handle("/", r)