|
1 | 1 | (defpackage #:wst.routing.woo
|
2 | 2 | (:use #:cl)
|
3 |
| - (:import-from #:wst.routing |
4 |
| - #:parse-uri |
5 |
| - #:response-content |
6 |
| - #:response-headers |
7 |
| - #:response-status |
8 |
| - #:make-request) |
9 | 3 | (:export
|
10 |
| - #:woo-env->request |
11 |
| - #:response->woo-response)) |
| 4 | + #:request-from-woo-env |
| 5 | + #:response-to-woo-response)) |
12 | 6 |
|
13 | 7 | (in-package :wst.routing.woo)
|
14 | 8 |
|
15 |
| -(defun woo-env->request (env) |
| 9 | +(defun request-from-woo-env (env) |
16 | 10 | (multiple-value-bind (path query hash)
|
17 |
| - (parse-uri (getf env :request-uri)) |
18 |
| - (make-request :uri path |
19 |
| - :query query |
20 |
| - :hash hash |
21 |
| - :headers (getf env :headers) |
22 |
| - :method (getf env :request-method) |
23 |
| - :content-type (getf env :content-type) |
24 |
| - :content-length (or (getf env :content-length) 0) |
25 |
| - :content (getf env :raw-body) |
26 |
| - :data (list :env env)))) |
| 11 | + (wst.routing:parse-uri (getf env :request-uri)) |
| 12 | + (wst.routing:make-request :uri path |
| 13 | + :query query |
| 14 | + :hash hash |
| 15 | + :headers (getf env :headers) |
| 16 | + :method (getf env :request-method) |
| 17 | + :content-type (getf env :content-type) |
| 18 | + :content-length (or (getf env :content-length) 0) |
| 19 | + :content (getf env :raw-body) |
| 20 | + :data (list :env env)))) |
27 | 21 |
|
28 |
| -(defun response->woo-response (response) |
29 |
| - (list (response-status response) |
30 |
| - (response-headers response) |
31 |
| - (list (response-content response)))) |
| 22 | +(defun response-to-woo-response (response) |
| 23 | + (list (wst.routing:response-status response) |
| 24 | + (wst.routing:response-headers response) |
| 25 | + (list (wst.routing:response-content response)))) |
0 commit comments