-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update the readme and set the port to display on start.
- Loading branch information
1 parent
84cc4c9
commit 594bc8c
Showing
2 changed files
with
10 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,22 @@ | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
"log" | ||
"net/http" | ||
) | ||
|
||
// main is the entrypoint for the application. | ||
func main() { | ||
// Set the port. | ||
port := 8080 | ||
|
||
// Register the services and load the routes. | ||
http.Handle("/", RegisterServices("html").LoadRoutes()) | ||
|
||
// Display message on the server. | ||
log.Println("Server started.") | ||
log.Printf("webapp started on port %v\n", port) | ||
|
||
// Run the web listener. | ||
log.Fatal(http.ListenAndServe(":8080", nil)) | ||
log.Fatal(http.ListenAndServe(fmt.Sprintf(":%v", port), nil)) | ||
} |