40 Ants

Missing Clack Guide! Build a Web Application in Common Lisp Like a Pro!


Listen Later

In this video, I tell you how to make a complex web application in Common Lisp and Clack.

You will see how you can add different middleware to your application, for example, logging all HTTP requests.

I will also show you how to distribute static files from the CL web server and how to combine several Clack applications

in one server so that each application responds in its own route.

Also, I will explain the difference between Clack and Hunchentoot. If you want to learn about it, watch the video to the end!

Timecodes:

00:29 What is Clack?

01:28 Comparing with WSGI
06:27 Adding Middlewares
08:35 Internals of LACK:BUILDER
12:35 Parametrizing Middlewares
16:35 Finding Middlewares
18:17 Adding Admin App
22:16 Serving Static
25:41 Adding Directory Index
30:25 Nested Clack Apps
33:14 Real World Example
39:30 Switching the HTTP Server
41:07 Final Words

Links:

  • Final Version of the Code: https://github.com/40ants/example-clack-app/blob/master/src/final.lisp
  • Python WSGI: https://en.wikipedia.org/wiki/Web_Server_Gateway_Interface
  • Spinneret - HTML Template Engine: https://github.com/ruricolist/spinneret
  • Tiny Routes: https://quickdocs.org/tiny-routes
  • RealWorld Example in Common Lisp: https://github.com/jeko2000/tiny-routes-realworld-example-app
  • Middlewares:

    • https://github.com/tamurashingo/lack-middleware-batis - Creates a connection to the database using cl-batis.
    • https://github.com/tamurashingo/lack-middleware-connection-pool - Also creates a connection, but using cl-dbi and uses pool.
    • https://github.com/rudolph-miller/lack-middleware-sql-logger - Logs the SQL queries made.
    • https://github.com/yanqirenshi/lack-middleware-validation - a set of functions for validating request parameters. The middleware itself just shows validation errors.
    • https://github.com/mtstickney/session-control - adds the destroy-session and change-session-id functions to the standard session middleware from Lack.
    • ...more
      View all episodesView all episodes
      Download on the App Store

      40 AntsBy