🚧 Created simple hello world app
This commit is contained in:
parent
c127dcd6fa
commit
567180570e
|
@ -0,0 +1,23 @@
|
||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"log"
|
||||||
|
"net/http"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
srv := http.Server{
|
||||||
|
Addr: ":3000",
|
||||||
|
Handler: http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {
|
||||||
|
fmt.Fprintln(w, "Hello, World!")
|
||||||
|
}),
|
||||||
|
}
|
||||||
|
|
||||||
|
log.Println("starting at :3000...")
|
||||||
|
if err := srv.ListenAndServe(); err != nil {
|
||||||
|
log.Fatalln("error:", err.Error())
|
||||||
|
}
|
||||||
|
|
||||||
|
log.Println("done!")
|
||||||
|
}
|
Loading…
Reference in New Issue