-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.rkt
52 lines (43 loc) · 1.15 KB
/
app.rkt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#lang racket
;; sbomcc
;; -------
;; imports
;; -------
(require
helpful
web-server/dispatch
web-server/servlet-env
web-server/http
web-server/templates)
;; ----------------
;; request handlers
;; ----------------
(define (start req)
(response/output
(lambda (op) (display (include-template "src/index.html") op))))
; (define (get-title req)
; (response/xexpr
; `(h1
; ([class "font-normal text-gray-900 text-4xl md:text-7xl leading-none mb-8"]
; [id "title"])
; ,(random-title title-header))))
; (define (get-lao-tzu req)
; (response/xexpr
; `(h1
; ([class "font-normal text-gray-300 text-3xl md:text-6xl lg:text-7xl"]
; [id "lao-tzu"])
; ,(random-quote lao-tzu-quotes))))
(define-values (api-dispatch api-url)
(dispatch-rules
[("") start]))
(serve/servlet
api-dispatch
#:command-line? #t
#:extra-files-paths (list
(build-path 'same "src" "assets" "css")
(build-path 'same "src" "assets" "image")
(build-path 'same "src"))
#:listen-ip "0.0.0.0"
#:port 8080
#:servlet-path ""
#:servlet-regexp #rx"")