Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

20 lines (15 sloc) 0.653 kb
;; -*- lexical-binding: t -*-
(add-to-list 'load-path
(file-name-directory (or load-file-name
(buffer-file-name (current-buffer)))))
(require 'elnode)
(defun handler (httpcon)
"Demonstration function"
(elnode-http-start httpcon "200"
'("Content-type" . "text/html")
`("Server" . ,(concat "GNU Emacs " emacs-version)))
(elnode-http-return httpcon
"<html><body><h1>Hello from EEEMACS.</h1></body></html>"))
(elnode-start 'handler (string-to-number (or (getenv "PORT") "8080")) "0.0.0.0")
(while t
(accept-process-output nil 1))
Jump to Line
Something went wrong with that request. Please try again.