An open API service indexing awesome lists of open source software.

https://github.com/xandkar/racket-web-server-hello-world

An expository hello-world Racket Web Server app
https://github.com/xandkar/racket-web-server-hello-world

racket

Last synced: 3 months ago
JSON representation

An expository hello-world Racket Web Server app

Awesome Lists containing this project

README

        

Racket Web Server hello-world app
=================================

I wanted to run a simple instance of the Racket Web Server,
dove into the docs,
resurfaced with the code captured in this repo.

Each required module is prefixed so it is clear what is coming from where!

Example usage
-------------

From terminal A:

$ ./server --help
usage: ./server [ ... ] [] ...

is one of

-d, --dev
Development mode: open browser, show stack traces, etc.
-a , --addr
Listen address.
-p , --port
Listen port.
-l , --log
Log file.
--help, -h
Show this help
--
Do not treat any remaining argument as a switch (at this level)

Multiple single-letter switches can be combined after
one `-`. For example, `-h-` is the same as `-h --`.

$ ./server
Your Web application is running at http://localhost:8000.
Stop this program at any time to terminate the Web Server.

From terminal B:

$ curl -i localhost:8000/hello
HTTP/1.1 200 OK
Transfer-Encoding: chunked
Server: Racket
Last-Modified: Sun, 10 Jul 2022 22:07:26 GMT
Date: Sun, 10 Jul 2022 22:07:26 GMT
Content-Type: text/html; charset=utf-8

Hello, world!