Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
k1ife committed Apr 29, 2014
0 parents commit eb41cec
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
package main

import ("net/http" ; "io")

func hello(res http.ResponseWriter, req *http.Request) {
res.Header().Set(
"Content-Type",
"text/html",
)
io.WriteString(
res,
`<!doctype html>
<html>
<head>
<title>Hello World</title>
</head>
<body>
Hello World!
</body>
</html>`,
)
}
func omg(res http.ResponseWriter, req *http.Request) {
res.Header().Set(
"Content-Type",
"text/html",
)
io.WriteString(
res,
`<!doctype html>
<html>
<head>
<title>OMG!</title>
</head>
<body>
OMG! It work's!
</body>
</html>`,
)
}
func main() {
http.HandleFunc("/hello", hello)
http.HandleFunc("/omg", omg)
http.ListenAndServe(":8080", nil)
}

0 comments on commit eb41cec

Please sign in to comment.