Skip to content

Commit 515877c

Browse files
authored
Merge pull request #12 from carlosms/mock-uast-endpoints
Mock uast endpoints
2 parents 81fb7bb + 17739e5 commit 515877c

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

server/handler/uast.go

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package handler
2+
3+
import (
4+
"net/http"
5+
6+
"github.com/src-d/gitbase-playground/server/serializer"
7+
)
8+
9+
// Parse : placeholder method
10+
func Parse() RequestProcessFunc {
11+
return func(r *http.Request) (*serializer.Response, error) {
12+
return nil, serializer.NewHTTPError(http.StatusNotImplemented, http.StatusText(http.StatusNotImplemented))
13+
}
14+
}
15+
16+
// Filter : placeholder method
17+
func Filter() RequestProcessFunc {
18+
return func(r *http.Request) (*serializer.Response, error) {
19+
return nil, serializer.NewHTTPError(http.StatusNotImplemented, http.StatusText(http.StatusNotImplemented))
20+
}
21+
}

server/router.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ func Router(
3838
r.Post("/query", handler.APIHandlerFunc(handler.Query(db)))
3939
r.Get("/tables", handler.APIHandlerFunc(handler.Tables(db)))
4040

41+
r.Post("/parse", handler.APIHandlerFunc(handler.Parse()))
42+
r.Post("/filter", handler.APIHandlerFunc(handler.Filter()))
43+
4144
r.Get("/version", handler.APIHandlerFunc(handler.Version(version)))
4245

4346
r.Get("/static/*", static.ServeHTTP)

0 commit comments

Comments
 (0)