Permalink
Browse files

moved

  • Loading branch information...
1 parent 52e3385 commit 13250f880ef0152c9258fe27fad36132f3fb304f @tobi committed Mar 28, 2012
Showing with 18 additions and 5 deletions.
  1. 0 {browser → }/TODO.tasks
  2. +15 −1 {browser → }/main.go
  3. 0 {browser → }/render.js
  4. +3 −4 run
File renamed without changes.
@@ -4,6 +4,7 @@ import (
"log"
"net/http"
"browser/phantom"
+ _ "browser/mogrify"
)
func param(r *http.Request, name string) string {
@@ -13,6 +14,10 @@ func param(r *http.Request, name string) string {
return ""
}
+func ServeFile(w http.ResponseWriter, r *http.Request, filename string) {
+ http.ServeFile(w, r, filename)
+}
+
func main() {
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
r.ParseForm()
@@ -28,7 +33,16 @@ func main() {
log.Printf("Error creating screenshot: %s", err)
http.Error(w, "Could not create screenshot", http.StatusInternalServerError)
} else {
- http.ServeFile(w, r, filename)
+
+ size := param(r, "size")
+
+ if size == "" {
+ ServeFile(w, r, filename)
+ } else {
+
+ }
+
+
return
}
}
File renamed without changes.
View
@@ -1,4 +1,3 @@
-#!/bin/sh
-cd browser
-go install
-exec $GOPATH/bin/browser
+#!/bin/sh -e
+go build
+exec ./browser

0 comments on commit 13250f8

Please sign in to comment.