Skip to content

Commit b5bec20

Browse files
committed
Tryin out postmodern.
1 parent d12585e commit b5bec20

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

example.asd

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
:serial t
33
:description "Example cl-heroku application"
44
:depends-on (#:hunchentoot
5-
#:cl-who)
5+
#:cl-who
6+
#:postmodern)
67
:components ((:file "package")
78
(:module :src
89
:serial t

src/hello-world.lisp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
(in-package :example)
22

3+
;; Database
4+
(unless (postmodern:connected-p postmodern:*database*)
5+
(postmodern:connect-toplevel "production_test" "postgres" "postgres" "localhost"))
6+
7+
;; Handlers
8+
(hunchentoot:define-easy-handler (hello-db :uri "/hello-db") (name)
9+
(setf (hunchentoot:content-type*) "text/plain")
10+
(format nil "From db: ~A" (postmodern:query (:select '* :from 'accounts))))
11+
312
(push (hunchentoot:create-folder-dispatcher-and-handler "/static/" "/app/public/")
413
hunchentoot:*dispatch-table*)
514

0 commit comments

Comments
 (0)