Skip to content

Commit

Permalink
Use define-app
Browse files Browse the repository at this point in the history
  • Loading branch information
mario-goulart committed Mar 1, 2014
1 parent 34fdbbc commit 369b194
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 14 deletions.
2 changes: 1 addition & 1 deletion example-app.scm
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
(use i-wonder)
(i-wonder "/" "wonderings.db")
(i-wonder '("/") "wonderings.db")
23 changes: 10 additions & 13 deletions i-wonder.scm
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,15 @@
(print "Could not find the database file (" db-file "). Aborting.")
(exit 1))

(add-request-handler-hook!
'i-wonder
(lambda (path handler)
(when (string-prefix? base-path path)
(parameterize ((enable-sxml #t)
(app-root-path base-path)
(db-credentials db-file)
(page-css "/css/i-wonder.css"))
(switch-to-sql-de-lite-database)
(awful-settings handler)))))

(parameterize ((enable-sxml #t))
(define-app i-wonder
matcher: base-path
handler-hook: (lambda (handler)
(parameterize ((enable-sxml #t)
(app-root-path (string-intersperse base-path "/"))
(db-credentials db-file)
(page-css "/css/i-wonder.css"))
(switch-to-sql-de-lite-database)
(awful-settings handler)))

(define (awful-badge)
`(div (@ (id "awful"))
Expand Down Expand Up @@ -90,7 +87,7 @@
;;;
;;; Pages
;;;
(define-page base-path
(define-page (main-page-path)
(lambda ()

(add-javascript
Expand Down

0 comments on commit 369b194

Please sign in to comment.