Nevím, co sem dál psát. Something server, Go, something.
This commit is contained in:
parent
bbf1d0136b
commit
6c99cecbbf
10
server/server/src/aps.go
Normal file
10
server/server/src/aps.go
Normal 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
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,7 +1,14 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import "fmt"
|
import (
|
||||||
|
"fmt"
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
func main() {
|
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?")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user