Skip to content
Snippets Groups Projects
Select Git revision
  • 5be4f0af10489219e16310b7f25f70ac3e16b341
  • master default protected
2 results

main.go

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    main.go 587 B
    package main
    
    import (
    	"assignment1"
    	"fmt"
    	"log"
    	"net/http"
    	"os"
    )
    
    func main() {
    
    	port := os.Getenv("PORT")
    	if port == "" {
    		port = "8080"
    	}
    
    	http.HandleFunc("/", assignment1.HandlerNil)
    	http.HandleFunc("/conservation/v1/country/", assignment1.HandlerCountry)
    	http.HandleFunc("/conservation/v1/species/", assignment1.HandlerSpecies)
    	http.HandleFunc("/conservation/v1/diag/", assignment1.HandlerDiag)
    	//http.HandleFunc("/conservation/v1/species2/", assignment1.HandlerOnlySpecies)
    	fmt.Println("Listening on port " + port)
    	log.Fatal(http.ListenAndServe(":"+port, nil))
    
    }