Don't know if it would be an instructive example, but the Pollen project server 
[1], though not intended for production use, is a self-contained HTTP server 
that handles dynamic generation of HTML (it even works with Scribble files), 
which sounds similar to what you're trying to do.

Jesse Alama's book Server: Racket [2] is an excellent resource. Among many 
other things, I learned that you can invent arbitrary HTTP methods beyond GET 
and POST, thereby avoiding encoding conventions like "?action=edit". Instead, 
you can just have an HTTP method called EDIT.

It's possible to use the Racket web server "behind" Apache, so that Apache 
handles the static file serving, and Racket handles computation. [3] 

[1] 
https://github.com/mbutterick/pollen/blob/master/pollen/private/project-server.rkt

[2] https://serverracket.com/

[3] 
http://docs.racket-lang.org/web-server-internal/Troubleshooting_and_Tips.html?q=apache#%28part._.How_do_.I_use_.Apache_with_the_.Racket_.Web_.Server_%29

> On Jan 6, 2019, at 7:33 AM, Stephen De Gabrielle <spdegabrie...@gmail.com> 
> wrote:
> 
> Do you think web-server/dispatch is the right approach?
> 
> My design is; 
> 
> GET http(s)://server/<filename in #:server-root-path> 
> -> serve static file at specified path
> GET http(s)://server/<filename in #:server-root-path>?action=edit 
> -> serve edit page servlet that retrieves scribble source
> GET http(s)://server/<filename not found in #:server-root-path> 
> -> serve edit page adding parameters ?action=edit or maybe new
> POST http(s)://server/<filename in #:server-root-path>   
> -> update scribble source file,  generate target html file in 
> #:server-root-path and redirect to target html file at 
> http(s)://server/<filename in #:server-root-path

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to