@@ -46,7 +46,6 @@ type Handler func(res *Response, req *Request)
4646type Router struct {
4747 notfound Handler
4848 handler http.Handler
49- minmiddleware []Handler
5049 middlewares []func (http.Handler ) http.Handler
5150 routes map [string ]* Routes
5251}
@@ -209,35 +208,22 @@ func (r *Router) Mount(path string, Router *Router) *Router {
209208 return r
210209}
211210
212- /**
213- * @info Injects Minima middleware to the stack
214- * @param {...Handler} [handler] The handler stack to append
215- * @returns {}
216- */
217- func (r * Router ) use (handler ... Handler ) {
218- r .minmiddleware = append (r .minmiddleware , handler ... )
219- }
211+
220212
221213/**
222214 * @info Injects net/http middleware to the stack
223215 * @param {...func(http.Handler)http.Handler} [handler] The handler stack to append
224216 * @returns {}
225217 */
226- func (r * Router ) useRaw (handler ... func (http.Handler ) http.Handler ) {
218+ func (r * Router ) use (handler ... func (http.Handler ) http.Handler ) {
227219 if r .handler != nil {
228220 panic ("Minima: Middlewares can't go after the routes are mounted" )
229221 }
230222 r .middlewares = append (r .middlewares , handler ... )
231223}
232224
233225//A dummy function that runs at the end of the middleware stack
234- func (r * Router ) middlewareHTTP (w http.ResponseWriter , rq * http.Request ) {
235- resp := response (w , rq )
236- req := request (rq )
237- for _ , fn := range r .minmiddleware {
238- fn (resp , req )
239- }
240- }
226+ func (r * Router ) middlewareHTTP (w http.ResponseWriter , rq * http.Request ) {}
241227
242228/**
243229 * @info Builds whole middleware stack chain into single handler
0 commit comments