kdr2 / sb-fastcgi Goto Github PK
View Code? Open in Web Editor NEWFastCGI low-level API and WSGI-Style API for SBCL
License: BSD 2-Clause "Simplified" License
FastCGI low-level API and WSGI-Style API for SBCL
License: BSD 2-Clause "Simplified" License
(ql:quickload :sb-fastcgi)
(asdf:operate 'asdf:load-op 'sb-fastcgi)
(sb-fastcgi:load-libfcgi "/usr/lib64/libfcgi.so.0.0.0")
(defun wsgi-app (env start-response)
(funcall start-response "200 OK"
'(("Server" . "nginx") ("Content-Type" . "text/html")))
(let ((post (funcall (cdr (assoc :POST-READER env)))))
(list "<br>ENV [show in alist format]: <br>"
env "<br>"
"<br>LISP FEATURES [show in list format]: <br>"
*features* "<br>"
"<br>POST BODY [read once]: <br>"
post "<br>")))
(defun run-app ()
(sb-fastcgi:socket-server-threaded
(sb-fastcgi:make-serve-function #'wsgi-app)
:inet-addr "127.0.0.1"
:port 9000))
(run-app)
;i turn to http://127.0.0.1/common.lisp?sbcl=nice it shows
ENV [show in alist format]:
((POST-READER . #) (HTTP_ACCEPT_LANGUAGE . zh-CN,zh;q=0.9,en;q=0.8,en-US;q=0.7) (HTTP_ACCEPT_ENCODING . gzip, deflate, br) (HTTP_SEC_FETCH_DEST . document) (HTTP_SEC_FETCH_USER . ?1) (HTTP_SEC_FETCH_MODE . navigate) (HTTP_SEC_FETCH_SITE . none) (HTTP_ACCEPT . text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9) (HTTP_USER_AGENT . Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4292.2 Safari/537.36) (HTTP_UPGRADE_INSECURE_REQUESTS . 1) (HTTP_SEC_CH_UA_MOBILE . ?0) (HTTP_SEC_CH_UA . "Chromium";v="88", "Google Chrome";v="88", ";Not\\A\"Brand";v="99") (HTTP_CONNECTION . keep-alive) (HTTP_HOST . 127.0.0.1) (FCGI_ROLE . RESPONDER))
LISP FEATURES [show in list format]:
(QUICKLISP ASDF3.3 ASDF3.2 ASDF3.1 ASDF3 ASDF2 ASDF OS-UNIX NON-BASE-CHARS-EXIST-P ASDF-UNICODE X86-64 GENCGC 64-BIT ANSI-CL COMMON-LISP ELF IEEE-FLOATING-POINT LINUX LITTLE-ENDIAN PACKAGE-LOCAL-NICKNAMES SB-LDB SB-PACKAGE-LOCKS SB-THREAD SB-UNICODE SBCL UNIX)
POST BODY [read once]:
#()
;there is no url info in env
;please tell me how to get it
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.