From a5ffe01c8806b720a99569dd407a4b14a67693e3 Mon Sep 17 00:00:00 2001 From: defanor Date: Tue, 5 Feb 2019 05:14:26 +0300 Subject: Use plain CGI This eliminates the last of large Haskell dependencies. The multipart enctype is not supported now. --- example/README.md | 22 +++++++++++++++++----- example/list.xsl | 10 ++++++---- example/view.xsl | 2 +- 3 files changed, 24 insertions(+), 10 deletions(-) (limited to 'example') diff --git a/example/README.md b/example/README.md index d70b595..3aa50bf 100644 --- a/example/README.md +++ b/example/README.md @@ -14,10 +14,17 @@ them. `list.xsl` includes report and search forms, and lists the bugs. -To quickly try it, run `spawn-fcgi -p 5152 /bin/env pgxhtml` in this -directory, with database connection environment variables set if -needed, an `127.0.0.1 pgxhtml-test` entry in `/etc/hosts`, and a nginx -config akin to the following: +To quickly try the example after preparing a database, it can be +invoked directly in the `example` directory, e.g.: + +```sh +echo | QUERY_STRING="t=list&q=select+bug_search('','',10,0)" pgxhtml +``` + +To try it with a web server, ensure that `fcgiwrap` is running (e.g., +`fcgiwrap -s 'tcp:127.0.0.1:5152'`), database connection environment +variables are set if needed, an `127.0.0.1 pgxhtml-test` entry is in +`/etc/hosts`, and a nginx config akin to the following is set: ``` server { @@ -26,8 +33,13 @@ server { location / { include fastcgi_params; - fastcgi_param PATH_INFO $fastcgi_script_name; + fastcgi_param SCRIPT_FILENAME /home/defanor/.cabal/bin/pgxhtml; + fastcgi_param FCGI_CHDIR /home/defanor/proj/haskell/pgxhtml/example/; fastcgi_pass 127.0.0.1:5152; } } ``` + +Then +[http://pgxhtml-test/?t=list&q=select+bug_search('','',10,0)](http://pgxhtml-test/?t=list&q=select%20bug_search(%27%27,%27%27,10,0)) +should be available. diff --git a/example/list.xsl b/example/list.xsl index f229e3e..f4b0cf3 100644 --- a/example/list.xsl +++ b/example/list.xsl @@ -11,13 +11,14 @@ +

Report

-
+
@@ -37,7 +38,7 @@

Search

- +
@@ -59,6 +60,7 @@
+
@@ -78,12 +80,12 @@ - + - + diff --git a/example/view.xsl b/example/view.xsl index 84a9d5a..8b5dde8 100644 --- a/example/view.xsl +++ b/example/view.xsl @@ -9,7 +9,7 @@ - back to listing + back to listing
ID
-- cgit v1.2.3