Imported project in git, removed bindata dependency

This commit is contained in:
2019-12-26 07:21:48 -09:00
committed by Christopher Ramey
parent b4cb7a823e
commit 948be25267
18 changed files with 230 additions and 491 deletions

View File

@ -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: