stop riding the short bus, no clue why this stuff is here. only adds confusion, removing (#1)

server exposes Router field
This commit is contained in:
Reed Allman
2017-07-30 16:31:31 -07:00
committed by Travis Reeder
parent 85f7a53cc0
commit 53cbe2d5a4
5 changed files with 5 additions and 120 deletions

View File

@@ -4,6 +4,7 @@ import (
"bytes"
"context"
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"net"
@@ -50,7 +51,6 @@ type Server struct {
apiURL string
specialHandlers []SpecialHandler
appListeners []AppListener
middlewares []Middleware
runnerListeners []RunnerListener
@@ -385,8 +385,10 @@ func (s *Server) bindHandlers(ctx context.Context) {
engine.Any("/r/:app", s.handleRunnerRequest)
engine.Any("/r/:app/*route", s.handleRunnerRequest)
// This final route is used for extensions, see Server.Add
engine.NoRoute(s.handleSpecial)
engine.NoRoute(func(c *gin.Context) {
logrus.Debugln("not found", c.Request.URL.Path)
c.JSON(http.StatusNotFound, simpleError(errors.New("Path not found")))
})
}
type appResponse struct {