Skip to content
Snippets Groups Projects
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
main.go 508 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)
	fmt.Println("Listening on port " + port)
	log.Fatal(http.ListenAndServe(":"+port, nil))

}