Next: File Server, Previous: Hello World UTF8, Up: Usage Examples [Contents][Index]
;;; hello-world-html.el --- html hello world server using Emacs Web Server
(ws-start
(lambda (request)
(with-slots (process headers) request
(ws-response-header process 200 '("Content-type" . "text/html"))
(process-send-string process "<html>
<head>
<title>Hello World</title>
</head>
<body>
<b>hello world</b>
</body>
</html>")))
9002)
This variation of the “hello world” example sends a text/html
response instead of a simple text/plain response.