Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import (
- "http"
- "io"
- "os"
- "fmt"
- "strconv"
- )
- func MainPage(w http.ResponseWriter, req *http.Request) {
- io.WriteString(w, "Hi, download here: <a href=\"/FileTest\">HERE</a>")
- }
- func main() {
- fmt.Print("Port: ")
- var hi int
- fmt.Scanf("%d", &hi)
- http.HandleFunc("/", func(w http.ResponseWriter, req *http.Request) {
- io.WriteString(w, "Hi")
- })
- err := http.ListenAndServe("0.0.0.0:" + strconv.Itoa(hi), nil)
- if err != nil {
- fmt.Print(err)
- fmt.Print((hi))
- }
- }
Add Comment
Please, Sign In to add comment