Move robeaux into it's own package
This commit is contained in:
parent
bccc355a19
commit
d7b2d04e2d
|
@ -1,4 +1,3 @@
|
|||
.sass-cache
|
||||
*.test
|
||||
robeaux
|
||||
profile.cov
|
||||
|
|
12
Makefile
12
Makefile
|
@ -20,15 +20,15 @@ ifeq (,$(shell which go-bindata))
|
|||
$(error robeaux not built! https://github.com/jteeuwen/go-bindata is required to build robeaux assets )
|
||||
endif
|
||||
cd api ; \
|
||||
git clone --depth 1 git://github.com/hybridgroup/robeaux.git ; \
|
||||
cd robeaux ; \
|
||||
git clone --depth 1 git://github.com/hybridgroup/robeaux.git robeaux-tmp; \
|
||||
cd robeaux-tmp ; \
|
||||
rm fonts/* ; \
|
||||
rm Makefile package.json README.markdown robeaux.gemspec css/fonts.css ; \
|
||||
touch css/fonts.css ; \
|
||||
echo "Updating robeaux to $(shell git rev-parse HEAD)" ; \
|
||||
go-bindata -pkg="api" -o robeaux.go -ignore=\\.git ./... ; \
|
||||
mv robeaux.go .. ; \
|
||||
go-bindata -pkg="robeaux" -o robeaux.go -ignore=\\.git ./... ; \
|
||||
mv robeaux.go ../robeaux ; \
|
||||
cd .. ; \
|
||||
rm -rf robeaux/ ; \
|
||||
go fmt ./robeaux.go ; \
|
||||
rm -rf robeaux-tmp/ ; \
|
||||
go fmt ./robeaux/robeaux.go ; \
|
||||
|
||||
|
|
|
@ -4,12 +4,14 @@ import (
|
|||
"crypto/subtle"
|
||||
"encoding/base64"
|
||||
"encoding/json"
|
||||
"github.com/bmizerany/pat"
|
||||
"github.com/hybridgroup/gobot"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
"github.com/bmizerany/pat"
|
||||
"github.com/hybridgroup/gobot"
|
||||
"github.com/hybridgroup/gobot/api/robeaux"
|
||||
)
|
||||
|
||||
// Optional restful API through Gobot has access
|
||||
|
@ -128,7 +130,7 @@ func (a *api) setHeaders(f func(http.ResponseWriter, *http.Request)) http.Handle
|
|||
|
||||
func (a *api) robeaux(res http.ResponseWriter, req *http.Request) {
|
||||
path := req.URL.Path
|
||||
buf, err := Asset(path[1:])
|
||||
buf, err := robeaux.Asset(path[1:])
|
||||
if err != nil {
|
||||
log.Println("Error serving static file:", err.Error())
|
||||
res.Write([]byte(err.Error()))
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package api
|
||||
package robeaux
|
||||
|
||||
import (
|
||||
"bytes"
|
Loading…
Reference in New Issue