skeeto / emacs-web-server

Extensible Emacs HTTP 1.1 server
The Unlicense
240 stars 31 forks source link

Replacing default servlet #16

Closed thblt closed 6 years ago

thblt commented 6 years ago

This is more a request for clarification than an issue: to replace the default/root servlet, one needs to use defun to redefine httpd/, and the defservlet macros are useless there, am I correct?

Thanks!

skeeto commented 6 years ago

While ugly, technically you can use defservlet with the empty symbol:

(defservlet ## text/plain ()
  (princ "Hello, world!"))

The symbol name is appended to "http/" and interned.

thblt commented 6 years ago

I didn't know about the empty symbol, thanks a lot!