File tree Expand file tree Collapse file tree 5 files changed +20
-17
lines changed
Expand file tree Collapse file tree 5 files changed +20
-17
lines changed Original file line number Diff line number Diff line change 1+ PROT = 8080
Original file line number Diff line number Diff line change 1+ web: go run main.go
Original file line number Diff line number Diff line change 11## Usage
22
3- ```
4- go run main.go
5-
6- go run main.go -client
7- ```
8-
9- request http://localhost:8080/ through postman
10-
11-
3+ ## Debug stage
124
135[ Data Race Detector] ( https://go.dev/doc/articles/race_detector )
14-
156```
167go run -race main.go
178
189go run -race main.go -client
1910```
11+ request http://localhost:8080/ through postman
2012
13+ ## Development with Heroku locally
14+ ```
15+ //start server locally
16+ heroku local -f Procfile.local
17+
18+ //start client locally
19+ go run main.go -client
20+ ```
2121
2222## Deploy to Heroku
2323
@@ -29,4 +29,7 @@ heroku create
2929git push heroku main
3030//open you app in browser
3131heroku open
32+
33+ //check logs
34+ heroku logs --tail
3235```
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ import (
1616 "github.com/gorilla/websocket"
1717)
1818
19- var addr = flag .String ("addr" , "localhost:8080 " , "http service address" )
19+ var addr = flag .String ("addr" , "localhost:5000 " , "http service address" )
2020
2121type GGrokClient struct {
2222}
Original file line number Diff line number Diff line change @@ -19,12 +19,6 @@ func main() {
1919 flag .Parse ()
2020 log .SetFlags (0 )
2121
22- port := os .Getenv ("PORT" )
23-
24- if port == "" {
25- log .Fatal ("$PORT must be set" )
26- }
27-
2822 if client {
2923 done := make (chan struct {})
3024 go func () {
@@ -37,6 +31,10 @@ func main() {
3731 <- done
3832 }
3933
34+ port := os .Getenv ("PORT" )
35+ if port == "" {
36+ log .Fatal ("$PORT must be set" )
37+ }
4038 s := core .NewServer ()
4139
4240 http .HandleFunc ("/$$ggrok" , s .Register )
You can’t perform that action at this time.
0 commit comments