Nevím, co sem dál psát. Something server, Go, something.

This commit is contained in:
Dejwut 2023-05-16 22:18:08 +02:00
parent bbf1d0136b
commit 6c99cecbbf
2 changed files with 19 additions and 2 deletions

10
server/server/src/aps.go Normal file
View File

@ -0,0 +1,10 @@
package main
import "net/http"
func Aps(res http.ResponseWriter, req *http.Request) {
if req.Method == "GET" {
res.WriteHeader(200)
return
}
}

View File

@ -1,7 +1,14 @@
package main
import "fmt"
import (
"fmt"
"net/http"
)
func main() {
fmt.Println("uwu")
http.HandleFunc("/api/v1/aps", Aps)
if err := http.ListenAndServe(":10000", nil); err != nil {
fmt.Println("Well, ListenAndServe on port 10000 failed. What now?")
}
}