Skip to content

Commit

Permalink
add server
Browse files Browse the repository at this point in the history
  • Loading branch information
chclock committed Feb 23, 2018
1 parent db61196 commit 787058b
Show file tree
Hide file tree
Showing 8 changed files with 718 additions and 365 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/lib
14 changes: 14 additions & 0 deletions demo.ss
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
(import (libra libra))

(get! "/"
(lambda (p) (default-make-response "GET request")))

(post! "/"
(lambda (p) (default-make-response "POST request")))

(get! "/blog/:user/:age"
(lambda (p)
(define content (string-append "p是储存所有参数(路由/请求)的关联表; " "User: " (params-ref p "user" "") ",Ages: " (params-ref p "age" "")))
(default-make-json (cons (cons "content" content) p))))

(libra:run 8080)
359 changes: 0 additions & 359 deletions libra/libra.core.ss

This file was deleted.

Loading

0 comments on commit 787058b

Please sign in to comment.