
hello racketeers!

I’m having a hard time figuring out how to serve a web-server/dispatch
-defined set of dispatching-rules

I figured I should be using serve/servlet
for it, but it kinda ends up bring up a set of other endpoints that I don’t want to have

and in general seems to not be taking in the dispatching rules into account, at all really :stuck_out_tongue:


anyone has any real-life examples of REST-like web services built on top of web-server/dispatch
that I could learn from? :slightly_smiling_face:

alright! figured out what was the problem :slightly_smiling_face: - turns out that not only I needed to specify a #:servlet-regex #rx””
when using serve/servlet
but I also needed a catch-all route in my dispatch-rules

(if anyone cares)

and while we are at it, any advice on deploying a racket web server?

@leandro Docker is probably the easiest way

@notjack yup, was thinking of making a small container with the executable inside

that’s how I’m doing erlang releases too

If your app is structured as a package whose main.rkt
file starts the app, then the racket-onbuild images I made will Just Work with it

but I might be missing some stuff when it comes to using raco exe …
since I can’t seem to run my executable due to a missing collection (tzinfo
?)

@notjack link? I’m looking mainly into a split build and run image, so I can build the executable in an alpine image, and bundle it as a separate, minimal image that can only run it (typically under 10mb + the piece of software to be ran in there)

You’ll have a lot of trouble building racket in an alpine image since racket uses glibc
rather than musl


interesting!

starred. will have a look

They’re available on docker hub as well

jackfirth/racket