Imported project in git, removed bindata dependency
This commit is contained in:
12
pages/api.go
12
pages/api.go
@ -4,9 +4,9 @@ import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"git.binarythought.com/cdramey/qurl/obj"
|
||||
"net"
|
||||
"net/http"
|
||||
"qurl/qurl"
|
||||
"time"
|
||||
)
|
||||
|
||||
@ -18,8 +18,8 @@ type apijson struct {
|
||||
|
||||
func (ctx *RootHandler) ServeAPI(w http.ResponseWriter, r *http.Request) {
|
||||
var (
|
||||
j apijson
|
||||
q *qurl.QURL
|
||||
j apijson
|
||||
q *obj.QURL
|
||||
err error
|
||||
)
|
||||
|
||||
@ -39,11 +39,11 @@ func (ctx *RootHandler) ServeAPI(w http.ResponseWriter, r *http.Request) {
|
||||
// Deal with URLs that already exist in the database
|
||||
if q != nil {
|
||||
j.Exists = true
|
||||
j.URL = fmt.Sprintf("https://qurl.org/%s", qurl.ToString(q.ID))
|
||||
j.URL = fmt.Sprintf("https://qurl.org/%s", obj.ToString(q.ID))
|
||||
goto complete
|
||||
}
|
||||
|
||||
q = &qurl.QURL{
|
||||
q = &obj.QURL{
|
||||
URL: u,
|
||||
Created: time.Now(),
|
||||
}
|
||||
@ -68,7 +68,7 @@ func (ctx *RootHandler) ServeAPI(w http.ResponseWriter, r *http.Request) {
|
||||
goto complete
|
||||
}
|
||||
|
||||
j.URL = fmt.Sprintf("https://qurl.org/%s", qurl.ToString(q.ID))
|
||||
j.URL = fmt.Sprintf("https://qurl.org/%s", obj.ToString(q.ID))
|
||||
|
||||
complete:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user