Skip to content
This repository
Newer
Older
100644 45 lines (30 sloc) 2.491 kb
3624ac81 »
2012-04-20 update README.md, it's much more detailed now
1 # README
09b088e8 »
2012-04-16 `start-http-server` and `stop-server` added.
2
5fdb50b8 »
2012-04-16 License added, README is now a bit more descriptive and the Hunchento…
3 mensa_server is a Common Lisp server for the Socialunch app (mensa_app).
09b088e8 »
2012-04-16 `start-http-server` and `stop-server` added.
4 For the interface definition see api.txt.
5
3624ac81 »
2012-04-20 update README.md, it's much more detailed now
6 ## Installation:
09b088e8 »
2012-04-16 `start-http-server` and `stop-server` added.
7
766c9829 »
2012-04-20 add links to README.md
8 This server is written in [Common Lisp](http://en.wikipedia.org/wiki/Common_Lisp), so you need a CL implementation.
9 It currently has only been tested on [SBCL](http://www.sbcl.org/), but it _should_ run on any conforming implementation, like [CLISP](http://www.clisp.org/) or [ClozureCL](http://ccl.clozure.com/).
3624ac81 »
2012-04-20 update README.md, it's much more detailed now
10
766c9829 »
2012-04-20 add links to README.md
11 mensa_server defines some asdf systems which you can load easily with [Quicklisp](http://www.quicklisp.org/).
12 The one you most probably want to use is `m-server` which uses [hunchentoot](http://weitz.de/hunchentoot/) as the http frontend.
13 To use [teepeedee2](https://github.com/vii/teepeedee2) as a frontend, load `m-server-tpd2`.
3624ac81 »
2012-04-20 update README.md, it's much more detailed now
14 Finally there is `m-server-core` which is the part shared by the two, you probably don't want to load it.
15
16 ## Usage:
17
18 Both asdf systems define the package `m-server` which currently exports two functions:
09b088e8 »
2012-04-16 `start-http-server` and `stop-server` added.
19
20 * `start-http-server`
21 Starts the server loop with http.
22 * `stop-server`
3624ac81 »
2012-04-20 update README.md, it's much more detailed now
23 Stops the server loop.
24
25 There will be a `start-https-server` function for https support, since all data is sent in plain text.
26
27 ## Backends:
28
29 You can choose a backend by creating an instance of a backend class (probably a subclass of `base-backend`) and assigning it to `*backend*`.
30 Note, that there is only `plain-backend` currently which keeps all data in simple lists.
766c9829 »
2012-04-20 add links to README.md
31 You can write your own backend by and defining methods on a certain backend type for the generics listed in backend-api.lisp.
3624ac81 »
2012-04-20 update README.md, it's much more detailed now
32 You probably want to use your own class (which may be a subclass of `base-backend`) for the backend type, since you need to hold some meaningful state in the backend object, but since you can define methods on everithing in CL, you also can define a string-backend.
33
34 ## Frontends:
35
36 You can choose between hunchentoot and teepeedee2 by loading the corresponding asdf system, but you can also write your own frontend:
37
38 * Create an asdf system for your frontend.
39 * Add `m-server-core` as a dependency.
40 * Define the functions `start-http-server` and `stop-server` to start and stop the server loop (`start-http-server` should not block).
41 * Define the macros `defget` and `defpost` which are used by `server.lisp` to define handlers for GET and POST requests.
42 * Make sure `server.lisp` is loaded after that (in the asdf system definition).
43
766c9829 »
2012-04-20 add links to README.md
44 You can look at the \*-frontend.lisp files, as well es the corresponding .asd files.
Something went wrong with that request. Please try again.