-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
37 lines (33 loc) · 1.09 KB
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package main
import (
"fmt"
"net/http"
"runtime"
"github.com/Com1Software/Go-Playground-for-Programmers/tree/main/playground"
)
//
//------------------ (c) 1992-2022 Com1 Software Development
//
func main() {
fmt.Printf("Go Playground for Programmers (c) Copyright Com1Software 1992-2022\n")
fmt.Printf("Operating System : %s\n", runtime.GOOS)
// args := os.Args
playground.Openbrowser("http://localhost:8080/")
fmt.Println("Server running....")
fmt.Println("Listening on port 8080")
fmt.Println("")
//------------------------------------------------ Home Page
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
xdata := playground.StartPage()
fmt.Fprint(w, xdata)
})
//------------------------------------------------ Test Page 1
http.HandleFunc("/testpage1", func(w http.ResponseWriter, r *http.Request) {
xdata := playground.TestPage1()
fmt.Fprint(w, xdata)
})
//-----------------------------------
//------------------------------------------------- Start Server
http.ListenAndServe(":8080", nil)
}
//-------------------------------------------------------------