Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
snooze
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
Setting up 2FA is now mandatory for all users.
Show more breadcrumbs
ehai
snooze
Commits
d2d0122e
Commit
d2d0122e
authored
9 years ago
by
João Távora
Browse files
Options
Downloads
Patches
Plain Diff
Improve README.md slightly
parent
b1300ea2
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
README.md
+15
-11
15 additions, 11 deletions
README.md
with
15 additions
and
11 deletions
README.md
+
15
−
11
View file @
d2d0122e
...
...
@@ -2,8 +2,9 @@
Snooze
=======
_Snooze_
is a framework for building REST web services in Common
Lisp.
_Snooze_
is an URL router for Common Lisp: it maps back and forth
between URL strings and CL concepts. It's designed around REST web
services.
The primary goal is to make the programmer stay as close to the
regular Lisp idioms as possible, even while writing with HTTP in mind.
...
...
@@ -130,7 +131,7 @@ easiest way is:
```
Though you should probably escape the HTML with something like
[
cl-who
][
cl-who
]
's
`escape-string-all`
`
. You might also consider
[
cl-who
][
cl-who
]
's
`escape-string-all`
. You might also consider
specializing directly to
`text/html`
once you start needing some more
HTML-specific behaviour.
...
...
@@ -225,7 +226,7 @@ gets sent to the client. It uses a generic function and two variables:
*
`*catch-http-conditions*`
Out of the box, there are no methods on
`explain-condition`
and the
first
two variables are set to `
t
`
by default
.
two variables are set to
`t`
.
This means that any HTTP condition or a Lisp error in your application
will generate a very terse reply in plain-text containing only the
...
...
@@ -323,7 +324,7 @@ GET beatle/3
```
where
`3`
is an id, to pass an actual
`beatle`
object to the
route. This is explained in the next section.
`
route. This is explained in the next section.
Tighter routes
---------------
...
...
@@ -381,7 +382,7 @@ where `uri-to-arguments` and `arguments-to-uri` might help:
resource
(
package-name
(
symbol-package
sym
))))
keyword-args
))))
```
```
`
We can now safely rewrite the remaining routes in much simpler fashion:
...
...
@@ -423,11 +424,14 @@ Other backends
_Snooze_ is backend-agnostic. You can use [Clack][clack], which is a
good option, or anything else.
_Snooze_
offers with
`make-clack-app`
for quickly jumping into the
action, but doesn't "require" Clack
in any sense. Here's a way to hook
_Snooze_
to Hunchentoot directly:
_Snooze_ offers with `
make-clack-app
`
and `
make-hunchentoot-app
` for
quickly jumping into the
action, but doesn't "require" Clack
or
Hunchentoot in any sense.
```
For reference, here's how to hook _Snooze_ to Hunchentoot directly
(this is more or less what the bundled `
make-hunchentoot-app
` does).
```lisp
(defclass snooze-acceptor (hunchentoot:acceptor)
((snooze-bindings :initarg :snooze-bindings :initform nil :accessor snooze-bindings)))
...
...
@@ -468,7 +472,7 @@ _Snooze_ to Hunchentoot directly:
;; to display when the URI is empty
:snooze-bindings `((*home-resource* . homepage))
args))))
```
``
`
`
Support
-------
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment