pas/test/test.go

30 lines
718 B
Go
Raw Normal View History

2024-07-15 20:24:27 +02:00
package main
import (
"log"
pas "git.gay/exhq/pas"
"git.gay/exhq/pas/Constants"
2024-07-15 20:24:27 +02:00
)
func main() {
err := pas.StartServer(42069, func(request Constants.Request, respond func(Constants.Response)) {
2024-07-18 19:17:10 +02:00
if request.Intent.Path == "/" {
respond(Constants.Response{
OperationSuccessClassification: Constants.OK,
ResponseHeader: map[string]string{},
Body: "first fucking shitternet page lets fucki ng go",
})
} else {
respond(Constants.Response{
OperationSuccessClassification: Constants.NOTFOUND,
ResponseHeader: map[string]string{},
Body: "",
})
}
2024-07-15 20:24:27 +02:00
}, nil)
if err != nil {
log.Fatal(err)
}
}