Skip to content

Commit

Permalink
go endpoint: minor tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
erichanson committed Oct 3, 2020
1 parent a3396bf commit 57e495b
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/go/aquameta/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func main() {
var response string

var db_query = fmt.Sprintf(
"select status, message, response, mimetype from endpoint.request(%v, %v, %v, %v::json,%v::json)",
"select status, message, response, mimetype from endpoint.request(%v, %v, %v, %v::json, %v::json)",
pq.QuoteLiteral(version),
pq.QuoteLiteral(req.Method),
pq.QuoteLiteral(apiPath),
Expand Down Expand Up @@ -143,8 +143,16 @@ func main() {
*/

resourceHandler := func(w http.ResponseWriter, req *http.Request) {
// request string
path := strings.SplitN(req.RequestURI,"?", 2)[0]
// path
// path := strings.SplitN(req.RequestURI,"?", 2)[0]
path, err := url.QueryUnescape(req.URL.Path)
if err != nil { log.Fatal(err) }

// query string
/*
m, err := url.ParseQuery(req.URL.RawQuery)
if err != nil { log.Fatal(err) }
*/

// count matching endpoint.resource
const match_count_q = `
Expand Down

0 comments on commit 57e495b

Please sign in to comment.