mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
Initial commit.
This commit is contained in:
21
helloserver.go
Normal file
21
helloserver.go
Normal file
@@ -0,0 +1,21 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/gorilla/mux"
|
||||
"log"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
r := mux.NewRouter()
|
||||
r.HandleFunc("/", Hello)
|
||||
|
||||
http.Handle("/", r)
|
||||
log.Fatal(http.ListenAndServe(":8081", nil))
|
||||
}
|
||||
|
||||
func Hello(w http.ResponseWriter, req *http.Request) {
|
||||
fmt.Fprintln(w, "Hello world!")
|
||||
}
|
||||
Reference in New Issue
Block a user