|
10 months ago | |
---|---|---|
docs | 10 months ago | |
src/core | 10 months ago | |
test | 10 months ago | |
.gitignore | 10 months ago | |
LICENSE.txt | 10 months ago | |
README.org | 10 months ago | |
changelog.org | 10 months ago | |
nite.asd | 10 months ago | |
project.org | 10 months ago |
README.org
NITE README
Note on GitHub
Please do not upload this code to GitHub. Although the license grants you that right, I urge you to use open source alternatives like Codeberg or a self-hosted forge.
Nite Web Framework
Common Lisp Web Framework based on clack. Designed for building Restful Web applications. Project is hosted on code.strangestack.com.
Installation
Simply clone in a place ASDF can find it and run:
(ql:quicklisp :nite)
Status
Nite aims to be a full featured web framework, inspired in part by Django REST Framework and Restas. Currently only the core functionality is implemented, defining routes and handlers. Eventually integration with an ORM, templating engine, and more complicated types of request handlers will be implemented. The core API should be more or less stable at this point, although such a guarantee cannot be made before version 1.0.0.
Current semantic version: 0.2.0
Basic example
(defpackage #:nite.example
(:use #:cl #:nite)
(:import-from #:clack
#:clackup))
(in-package #:nite.example)
(define-handler index (:method :get) ()
'(200 () ("Hello World!!")))
(define-handler hello-name (:method :get) (route-parameters)
(list 200 () (list (format nil "Hello, Your name is: ~A" (cdr (assoc :name route-parameters))))))
(define-handler-set form-test
((:method :get) (query-parameters)
(list 200 ()
(list (if query-parameters
(format nil "<p>query-parameters: ~A</p>" query-parameters))
"
<form method=POST>
<label for=\"fname\">First name:</label><br>
<input type=\"text\" id=\"fname\" name=\"fname\"><br>
<label for=\"lname\">Last name:</label><br>
<input type=\"text\" id=\"lname\" name=\"lname\">
<input type=\"submit\" value=\"Submit\">
</form>")))
((:method :post) (body-parameters)
(list 200 nil (list (format nil "Request body: ~A" body-parameters)))))
(define-app main ()
(:uri "/" 'index)
(:uri "/hello/:name" 'hello-name)
(:uri "/form" 'form-test))
;(clackup #'main)
Documentation
See docs.
Running Tests
nite
uses Parachute for it's unit-testing. To run the tests simply run:
(asdf:test-system '#:nite)
Or manually
(ql:quickload #:nite/test)
(parachute:test 'nite.test)
Work Log.
Date | Contributor | Description | Effort(in hours) |
---|---|---|---|
<2023-02-23 Thu> | lispegistus | Initial effort for 0.1.0 1 | 140 |
<2023-02-26 Sun> | lispegistus | Release 0.2.0 | 12 |
Total | 152 |
About the Author
My name is Pavel Penev aka Lispegistus.
My code and writings is collected at https://strangestack.com. See the About page for more.
License
Licensed under the GPL-3.0 license. See file LICENSE.txt for the full text of the license.
I've worked on this project on and off since 2021, I've redesigned it several times and the number of hours specified is only the hours I have at least some notes about since I restarted this project a few weeks ago. The number is likely higher