Browse Source

Удалить 'main (1).go'

gr782_lva 3 years ago
parent
commit
3073cf66d2
1 changed files with 0 additions and 43 deletions
  1. 0 43
      main (1).go

+ 0 - 43
main (1).go

@@ -1,43 +0,0 @@
-package main
-
-import (
-"fmt"
-"log"
-"net/http"
-"strings"
-"time"
-)
-
-func main() {
-http.HandleFunc("/", slash) // Устанавливаем роутер (Следующие аналогично)
-http.HandleFunc("/ok", ok)
-http.HandleFunc("/info", info)
-http.HandleFunc("/status", status)
-err := http.ListenAndServe(":80", nil) // Ставим порт 80 так как HTTP
-if err != nil {
-log.Fatal("ListenAndServe: ", err)
-}
-}
-
-func slash (w http.ResponseWriter,r *http.Request) {
-fmt.Fprint(w,"Если вы видите этот текст, значит это каким то образом работает")
-}
-func ok (w http.ResponseWriter,r *http.Request) {
-w.WriteHeader(http.StatusOK)
-fmt.Fprint(w,"Возвращает для HTTP статус OK")
-}
-func info (w http.ResponseWriter,r *http.Request) {
-fmt.Fprint(w,"Выдает информацию о хозяине то есть Ли Владислав")
-}
-
-func status (w http.ResponseWriter,r *http.Request) {
-var remoteIp = r.RemoteAddr
-var splitIp = strings.Split(remoteIp, ".")
-var fmtIP = fmt.Sprint(splitIp[0], ".x.x.", strings.Split(splitIp[3], ":")[0])
-
-var fmtDate = time.Now().Format("2006-01-02 3:4:5 pm")
-
-fmt.Fprintf(w,"Ли Владислав\n")
-fmt.Fprintf(w, fmtDate + "\n")
-fmt.Fprintf(w, fmtIP)
-}