awacke1 commited on
Commit
2603033
·
1 Parent(s): a4561fd

Create main.go

Browse files
Files changed (1) hide show
  1. main.go +17 -0
main.go ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ package main
2
+
3
+ import (
4
+ "fmt"
5
+ "net/http"
6
+ "net/url"
7
+ )
8
+
9
+ func main() {
10
+ http.HandleFunc("/", HelloServer)
11
+ http.ListenAndServe(":8080", nil)
12
+ }
13
+
14
+ func HelloServer(w http.ResponseWriter, r *http.Request) {
15
+ m, _ := url.ParseQuery(r.URL.RawQuery)
16
+ fmt.Fprintf(w, "Hello, %s!", m["q"])
17
+ }