Skip to content
This repository has been archived by the owner on Nov 9, 2022. It is now read-only.

Commit

Permalink
added main.go
Browse files Browse the repository at this point in the history
  • Loading branch information
masahide committed Mar 21, 2015
1 parent 8ed2943 commit 0ab9c8d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions Procfile
@@ -0,0 +1 @@
web: inet-ip.info
20 changes: 20 additions & 0 deletions main.go
@@ -0,0 +1,20 @@
package main

import (
"fmt"
"net/http"
"os"
)

func main() {
http.HandleFunc("/", hello)
fmt.Println("listening...")
err := http.ListenAndServe(":"+os.Getenv("PORT"), nil)
if err != nil {
panic(err)
}
}

func hello(res http.ResponseWriter, req *http.Request) {
fmt.Fprintln(res, "hello, world")
}

0 comments on commit 0ab9c8d

Please sign in to comment.