]> code.delx.au - gnu-emacs-elpa/blob - examples/4-file-server.el
match more HTTP methods
[gnu-emacs-elpa] / examples / 4-file-server.el
1 ;;; file-server.el --- serve any files using Emacs Web Server
2
3 ;; Copyright (C) 2013 Eric Schulte <schulte.eric@gmail.com>
4
5 ;; Author: Eric Schulte <schulte.eric@gmail.com>
6 ;; Keywords: http post
7 ;; License: GPLV3 (see the COPYING file in this directory)
8
9 ;;; Commentary
10
11 ;; This example uses absolute paths and will try to serve files from
12 ;; the root of the file-system, so don't run it on a public server.
13
14 ;;; Code:
15 (require 'emacs-web-server)
16
17 (ews-start
18 '(((:GET . ".*") .
19 (lambda (proc request) (ews-send-file proc (cdr (assoc :GET request))))))
20 9004)