Skip to content

Commit

Permalink
added binaries and readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Nelwhix committed Jun 1, 2023
1 parent 7281b3e commit 4ce3795
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Serve
For starting http servers on localhost

## Usage
```bash
serve // this starts a server on port 3000

// To use a custom port run
serve -p 5173
```

10 changes: 5 additions & 5 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ package main
import (
"flag"
"fmt"
"net/http"
"os"
"os/signal"
"strconv"
"time"
"syscall"
"net/http"
"os/signal"
"time"
)

func main() {
Expand All @@ -33,7 +33,7 @@ func main() {

for {
select {
case rec := <-sig:
case _ = <-sig:
signal.Stop(sig)
fmt.Println("Gracefully shutting down..")
case err := <-errCh:
Expand All @@ -59,5 +59,5 @@ func serve(port int64, errChan chan error) {
errChan <- err
return
}
fmt.Printf("Server starting on port: %v", port)
fmt.Fprintf(os.Stdout, "Server starting on port: %v", port)
}
Binary file added serve
Binary file not shown.
Binary file added serve.exe
Binary file not shown.

0 comments on commit 4ce3795

Please sign in to comment.