Created
March 27, 2017 20:43
-
-
Save jeffotoni/bcc6b2e2c43769b70e51b5a949ecee13 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** @autor jeffotoni */ | |
package main | |
import ( | |
"fmt" | |
"log" | |
"net/http" | |
"github.com/gorilla/mux" | |
) | |
func main() { | |
fmt.Println("Conect port : 4002") | |
fmt.Println("Instance /register") | |
///create route | |
router := mux.NewRouter().StrictSlash(true) | |
router. | |
HandleFunc("/register", func(w http.ResponseWriter, r *http.Request) { | |
fmt.Println(r.Method) | |
}) | |
// router.haHandleFunc("/register", Teste2). | |
// Methods("POST") | |
log.Fatal(http.ListenAndServe(":4002", router)) | |
} | |
func Teste(w http.ResponseWriter, r *http.Request) { | |
fmt.Fprintln(w, "http teste ... ") | |
} | |
func Teste2(w http.ResponseWriter, r *http.Request) { | |
fmt.Fprintln(w, "http teste 2... ") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment