Created
March 27, 2017 20:11
-
-
Save jeffotoni/d3a1fff8fbb88b9906c5a9f5ab9fb311 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
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() | |
router. | |
HandleFunc("/register", Teste). | |
Methods("GET") | |
router.HandleFunc("/register", Teste2). | |
Methods("POST") | |
//After 5 minutes synchronize file upload | |
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