This seems like a super simple stupid question, but those are allowed as well I guess.
I created a new app using the SAFE stack that I wanted to test out, but failed on thing that should be simple.
All I wanted to do was respond to a request to an endpoint at the root like /webhook. So I thought I will use my copy paste skills and changed the webApp part to:
let webApp = router {
get "webhook" (fun next ctx ->
task {
let counter = {Value = 42}
return! json counter next ctx
})
get "/api/init" (fun next ctx ->
task {
let counter = {Value = 42}
return! json counter next ctx
})
Now when I run the app /api/init works but /webhook doesn't. Any ideas why that is?
My app part look like this:
let app =
application {
url ("http://0.0.0.0:" + port.ToString() + "/")
use_router webApp
use_json_serializer(Thoth.Json.Giraffe.ThothSerializer())
use_gzip
}
run app
It is basically what you get from the SAFE template but I added my endpoint.
This seems like a super simple stupid question, but those are allowed as well I guess.
I created a new app using the SAFE stack that I wanted to test out, but failed on thing that should be simple.
All I wanted to do was respond to a request to an endpoint at the root like
/webhook
. So I thought I will use my copy paste skills and changed thewebApp
part to:Now when I run the app
/api/init
works but/webhook
doesn't. Any ideas why that is?My app part look like this:
It is basically what you get from the SAFE template but I added my endpoint.