|
@@ -0,0 +1,33 @@
|
|
|
+package main
|
|
|
+
|
|
|
+import (
|
|
|
+ "fmt"
|
|
|
+ "log"
|
|
|
+ "net/http"
|
|
|
+ "time"
|
|
|
+)
|
|
|
+
|
|
|
+func main() {
|
|
|
+ http.HandleFunc("/IaSdam", IaSdam)
|
|
|
+ http.HandleFunc("/HTTP200", HTTP200)
|
|
|
+ http.HandleFunc("/SkolkoVremeni", SkolkoVremeni)
|
|
|
+ err := http.ListenAndServe(":8080", nil)
|
|
|
+ if err != nil {
|
|
|
+ log.Fatal("ListenAndServe: ", err)
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+func HTTP200(w http.ResponseWriter, r *http.Request) {
|
|
|
+ w.WriteHeader(200)
|
|
|
+ fmt.Fprintf(w, "status")
|
|
|
+}
|
|
|
+
|
|
|
+func IaSdam(w http.ResponseWriter, r *http.Request) {
|
|
|
+ fmt.Fprintf(w, "Ложников Н.С."+"\n")
|
|
|
+ fmt.Fprintf(w, "МДК.02.03.ОАКС"+"\n")
|
|
|
+}
|
|
|
+
|
|
|
+func SkolkoVremeni(w http.ResponseWriter, r *http.Request){
|
|
|
+ time := time.Now()
|
|
|
+ fmt.Fprintln(w, time.Format("2006-01-02 3:4:5 pm"))
|
|
|
+}
|