Skip to content

Commit 5d30fad

Browse files
committed
Add todomvc/serve.go
1 parent ff6fc73 commit 5d30fad

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

todomvc/readme.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ You will also need to install GopherJS with `go get github.com/gopherjs`.
5555
Then run `go generate ./...` to compile the templates and compile the go code
5656
to javascript.
5757

58-
Finally, serve the project directory with `python -m SimpleHTTPServer` or similar
59-
and visit [localhost:8000](http://localhost:8000) in your browser.
58+
Finally, serve the project directory with `go run serve.go` and visit
59+
[localhost:8000](http://localhost:8000) in your browser.
6060

6161

6262
## Credit

todomvc/serve.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package main
2+
3+
import (
4+
"log"
5+
"net/http"
6+
)
7+
8+
func main() {
9+
port := ":8000"
10+
log.Println("Serving on http://localhost" + port)
11+
http.ListenAndServe(port, http.FileServer(http.Dir(".")))
12+
}

0 commit comments

Comments
 (0)