[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 22/119: file serving example
From: |
Eric Schulte |
Subject: |
[elpa] 22/119: file serving example |
Date: |
Mon, 10 Mar 2014 16:57:06 +0000 |
eschulte pushed a commit to branch master
in repository elpa.
commit df14b9531b3dc7ce0796086d2516503b87ea34e9
Author: Eric Schulte <address@hidden>
Date: Wed Dec 18 23:20:25 2013 -0700
file serving example
---
examples/4-file-server.el | 20 ++++++++++++++++++++
1 files changed, 20 insertions(+), 0 deletions(-)
diff --git a/examples/4-file-server.el b/examples/4-file-server.el
new file mode 100644
index 0000000..877bc76
--- /dev/null
+++ b/examples/4-file-server.el
@@ -0,0 +1,20 @@
+;;; file-server.el --- serve any files using Emacs Web Server
+
+;; Copyright (C) 2013 Eric Schulte <address@hidden>
+
+;; Author: Eric Schulte <address@hidden>
+;; Keywords: http post
+;; License: GPLV3 (see the COPYING file in this directory)
+
+;;; Commentary
+
+;; This example uses absolute paths and will try to serve files from
+;; the root of the file-system, so don't run it on a public server.
+
+;;; Code:
+(require 'emacs-web-server)
+
+(ews-start
+ '(((:GET . ".*") .
+ (lambda (proc request) (ews-send-file proc (cdr (assoc :GET request))))))
+ 9004)
- [elpa] 15/119: more lenient parsing of multipart forms, (continued)
- [elpa] 15/119: more lenient parsing of multipart forms, Eric Schulte, 2014/03/10
- [elpa] 12/119: compiling to .elc, Eric Schulte, 2014/03/10
- [elpa] 13/119: tasks, Eric Schulte, 2014/03/10
- [elpa] 18/119: 404 not found helper, Eric Schulte, 2014/03/10
- [elpa] 17/119: handling errors, Eric Schulte, 2014/03/10
- [elpa] 14/119: better requirements for test, Eric Schulte, 2014/03/10
- [elpa] 16/119: tasks, Eric Schulte, 2014/03/10
- [elpa] 20/119: don't require non-nil return to close connection, Eric Schulte, 2014/03/10
- [elpa] 19/119: simply (name . content) for form elements, Eric Schulte, 2014/03/10
- [elpa] 21/119: helper to send a file with mime type, Eric Schulte, 2014/03/10
- [elpa] 22/119: file serving example,
Eric Schulte <=
- [elpa] 23/119: handle close-connection thrown during header parse, Eric Schulte, 2014/03/10
- [elpa] 25/119: seems to be generally usable, added a README, Eric Schulte, 2014/03/10
- [elpa] 24/119: parse application/x-www-form-urlencoded post data, Eric Schulte, 2014/03/10
- [elpa] 26/119: thread proc through some functions, Eric Schulte, 2014/03/10
- [elpa] 28/119: testing a hello-world server, Eric Schulte, 2014/03/10
- [elpa] 27/119: run test processes asynch, Eric Schulte, 2014/03/10
- [elpa] 29/119: update examples, Eric Schulte, 2014/03/10
- [elpa] 31/119: match more HTTP methods, Eric Schulte, 2014/03/10
- [elpa] 30/119: fleshed out some more tests, Eric Schulte, 2014/03/10
- [elpa] 32/119: url-encoded parameters, Eric Schulte, 2014/03/10