initial commit
This commit is contained in:
16
.gitignore
vendored
Normal file
16
.gitignore
vendored
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
# Dependencies
|
||||||
|
/node_modules/
|
||||||
|
|
||||||
|
# Compiled frontend assets (run `npm run build` to regenerate)
|
||||||
|
/public/assets/app.css
|
||||||
|
/public/assets/htmx.min.js
|
||||||
|
|
||||||
|
# Environment / secrets
|
||||||
|
.env
|
||||||
|
.env.*
|
||||||
|
!.env.example
|
||||||
|
|
||||||
|
# Editor / OS
|
||||||
|
.DS_Store
|
||||||
|
|
||||||
|
*.db
|
||||||
6
haus-tf.asd
Normal file
6
haus-tf.asd
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
(defsystem "haus-tf"
|
||||||
|
:version "0.0.1"
|
||||||
|
:author "Rawley Fowler"
|
||||||
|
:license "MIT"
|
||||||
|
:depends-on ("woo" "clack" "lack" "spinneret" "cl-dbi" "ningle")
|
||||||
|
:components ((:file "main")))
|
||||||
25
main.lisp
Normal file
25
main.lisp
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
(defpackage :haus-tf
|
||||||
|
(:use :cl :ningle :lack :cl-dbi)
|
||||||
|
(:export #:*app*))
|
||||||
|
|
||||||
|
(in-package :haus-tf)
|
||||||
|
|
||||||
|
(defvar *ningle-app* (make-instance 'ningle:app))
|
||||||
|
(defvar *app*
|
||||||
|
(lack:builder
|
||||||
|
:session
|
||||||
|
*ningle-app*))
|
||||||
|
|
||||||
|
(defvar *db* (dbi:connect :sqlite3
|
||||||
|
:database-name "haus-tf.db"))
|
||||||
|
|
||||||
|
(setf (ningle:route *ningle-app* "/foo")
|
||||||
|
#'(lambda (params)
|
||||||
|
(declare (ignore params))
|
||||||
|
(let* ((query (dbi:prepare *db* "SELECT unixepoch() as EPOCH"))
|
||||||
|
(result (dbi:execute query))
|
||||||
|
(time (getf (dbi:fetch result) :EPOCH)))
|
||||||
|
(format nil "Time: ~A" time))))
|
||||||
|
|
||||||
|
(setf (ningle:route *ningle-app* "/")
|
||||||
|
"Hello from Common Lisp!")
|
||||||
Reference in New Issue
Block a user