diff options
| -rw-r--r-- | .dir-locals.el | 3 | ||||
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | Makefile | 9 | ||||
| -rw-r--r-- | README.md | 39 | ||||
| -rw-r--r-- | weeb/fcgi.scm | 6 |
5 files changed, 57 insertions, 1 deletions
diff --git a/.dir-locals.el b/.dir-locals.el new file mode 100644 index 0000000..a8a6a6a --- /dev/null +++ b/.dir-locals.el @@ -0,0 +1,3 @@ +((scheme-mode + (eval . (progn + (put 'with-accessors 'scheme-indent-function 1))))) diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6ec2c2b --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +weeb/*.so diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..08ba61e --- /dev/null +++ b/Makefile @@ -0,0 +1,9 @@ +CC=gcc +LDLIBS=-lfcgi + +LIBS_REQUIRED=guile-3.0 +CFLAGS+=$(shell pkg-config --cflags $(LIBS_REQUIRED)) +LDLIBS+=$(shell pkg-config --libs $(LIBS_REQUIRED)) + +weeb/gfcgi.so: src/fcgi.c + $(CC) $(CFLAGS) -fPIC -shared -o weeb/gfcgi.so $(LDLIBS) src/fcgi.c diff --git a/README.md b/README.md new file mode 100644 index 0000000..025b2aa --- /dev/null +++ b/README.md @@ -0,0 +1,39 @@ +# weeb + +weeb is a web microframework for GNU Guile built on [FastCGI](FastCGI). +It aims to provide a comprehensive library for building dynamic websites +in Scheme, while being leaner, faster, and more stable than Guile's +`(web server)` module, and integrating well with common web servers like +[Apache](https://en.wikipedia.org/wiki/Apache_HTTP_Server) and +[nginx](https://en.wikipedia.org/wiki/Nginx). + +API is subject to change. + +## Requirements + +- GNU Guile 3.0 or later with `--enable-regex` +- `libfcgi-2.4.1` +- A web server with FCGI proxy support + +## Building + +There is one small wrapper library for `libfcgi` that needs to be built. +Just run `make`. + +## Using + +```sh +$ spawn-fcgi -s /tmp/guile-fcgi.sock -- ... +``` + +Where `...` is however you would invoke Guile to run your program. + +### Apache Vhost + +```xml +<VirtualHost *:80> + ServerName mysite.local + ProxyPassMatch ^/ unix:/tmp/guile-fcgi.sock|fcgi://localhost/ +</VirtualHost> + +``` diff --git a/weeb/fcgi.scm b/weeb/fcgi.scm index 8d28edf..1c3f823 100644 --- a/weeb/fcgi.scm +++ b/weeb/fcgi.scm @@ -17,8 +17,12 @@ ;;; License along with Weeb. If not, see <https://www.gnu.org/licenses/>. (define-module (weeb fcgi) + #:use-module (ice-9 ftw) #:export (fcgi-accept fcgi-display fcgi-read)) -(load-extension "./gfcgi" "init_libfcgi") +(eval-when (load) + (let* ((here (current-filename)) + (dir (dirname here))) + (load-extension (string-append dir "/gfcgi") "init_libfcgi"))) |