Common lisp web framework Based on Clack. Designed for building Restful Web applications.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
Pavel Penev f7453e3732
updated docs
10 months ago
docs updated docs 10 months ago
src/core updated docs 10 months ago
test Refactored routing 10 months ago
.gitignore initial commit 10 months ago
LICENSE.txt initial commit 10 months ago
README.org Refactored routing 10 months ago
changelog.org Refactored routing 10 months ago
nite.asd Refactored routing 10 months ago
project.org Refactored routing 10 months ago

README.org

NITE README

Note on GitHub

Please don't upload to 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.


1

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