Answer the question
In order to leave comments, you need to log in
How to make something like blueprint flask using gorilla mux??
Hello, in the flask everything just has blueprints and in the main app we just hang each blueprint on its sub-urls
app.register_blueprint('/', a_BP)
app.register_blueprint('/b', b_BP)
app.register_blueprint('/c', c_BP)
app.register_blueprint('/d'', d_BP)
Answer the question
In order to leave comments, you need to log in
In theory , Subrouter will suit you . You can do something like this:
import (
"blue_prints/bp1"
"blue_prints/bp2"
)
r := mux.NewRouter()
sub_router1 := r.PathPrefix("/bp1").Subrouter()
sub_router2 := r.PathPrefix("/bp2").Subrouter()
bp1.Register(sub_router1)
bp2.Register(sub_router2)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question