Initial commit

This commit is contained in:
2020-05-08 14:30:50 +01:00
commit 175354acd3
8 changed files with 146 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
package main
import (
"fmt"
qrcode "github.com/skip2/go-qrcode"
"net/http"
)
func main() {
http.HandleFunc("/", func(w http.ResponseWriter, req *http.Request) {
website := req.URL.Query().Get("website")
if website != "" {
png, _ := qrcode.Encode(website, qrcode.Medium, 80)
w.Write(png)
return
}
w.WriteHeader(400)
})
fmt.Println(http.ListenAndServe(":8080", nil))
}