Commit Graph

22 Commits

Author SHA1 Message Date
hallgren
0e87a88f4b src/server: refactoring to isolate dependencies on the cgi/fastcgi packages
* Introducing the module CGI, re-exporting a subset of the cgi package. It
  might complete replace the cgi package in the future.
* Introducing the module CGIUtils, containing functions from FastCGIUtils that
  have nothing to do with fastcgi.

Some low level hackery with unsafePerformIO and global variables was left
in FastCGIUtils, but it is actually not used, neither for gf -server nor
exec/pgf-fcgi.hs.
2014-09-02 12:27:47 +00:00
hallgren
fb61fc4562 Cloud & PGF service: use Content-Type application/json for JSON output
This is in accordance with RFC 4627. http://tools.ietf.org/html/rfc4627
Use application/javascript for JSONP output.
2013-07-29 16:05:54 +00:00
hallgren
eb2b5a65d6 Allow cross origin requests to GF cloud & PGF services
By adding a header

	Access-Control-Allow-Origin: *

to the HTTP responses, web browsers are informed that it is OK to call the
services from web pages hosted on other sites.

This is apparently supported in most modern browsers, so it should no longer
be necessary to resort to JSONP.

See https://developer.mozilla.org/en-US/docs/HTTP/Access_control_CORS
2013-07-25 16:04:43 +00:00
hallgren
eb21f73fd3 PGF service: new command: download
This makes it possible to download PGF files from servers where the PGF service
is installed.

I am also considering making commmand=download the default instead of
command=grammar.
2013-01-09 13:28:45 +00:00
hallgren
3e2f768072 pgf service: added a hook for external services
This is really reinventing CGI, people should learn how to write CGI scripts
instead...
TODO: better handling of temporary files
2011-08-22 15:34:44 +00:00
hallgren
681c5d25dd PGF web service: Use Content-Type text/javascript from JSON output
The Content-Type used to be text/json, but this caused warning messages in
some web browers.
2010-12-22 14:47:35 +00:00
hallgren
5fd4efd960 Split pgf-server into pgf-fcgi and pgf-http.
The dependency on the fastcgi package made pgf-server difficult to compile, so
it is now split into

  - pgf-fgci (main module in pgf-fcgi.hs), which is built only if fastcgi is
    already installed or if you turn on the fastcgi flag (e.g. by doing
    'cabal install -f fastcgi').

  - pgf-http (main module in pgf-http.hs) which is always built (and hopefully
    has no problematic dependencies.) 

The modules FastCGIUtils and PGFService no longer depend on fastcgi.
2010-11-26 14:30:51 +00:00
krasimir
b8214aff83 fix: FastCGIUtils.outputHTML should do UTF8 encoding 2010-07-31 13:56:55 +00:00
krasimir
f806a7890d now the PGF service communicates with Graphviz using UTF8 for the input and binary for the output 2010-04-22 14:01:08 +00:00
krasimir
a4894be101 the pgf service now compiles with the latest CGI package 2010-04-22 12:37:36 +00:00
krasimir
836e742ddf TranslateApp now have browser for abstract syntax 2009-11-29 14:51:12 +00:00
krasimir
73e1f0e81e added tree visualizations in TranslateApp 2009-10-24 10:38:21 +00:00
krasimir
0fd18dafa9 Update FastCGIUtils.hs to work with GHC 6.10 2009-06-04 14:56:50 +00:00
krasimir
bca1991d05 hack for pgf-server for Windows 2009-01-25 15:07:29 +00:00
bjorn
dd58077add Fix permissions of pgf server error log. 2008-11-20 09:52:18 +00:00
bjorn
76b8d37824 pgf-server: write stderr to pgf-error.log, since lighttpd closes stderr for fastcgi processes. 2008-11-04 09:28:21 +00:00
bjorn
7ae8c798e9 gf-server: move some general stuff to FastCGIUtils 2008-10-20 15:17:57 +00:00
bjorn
e7656c9d2e (fastcgi) replace DataRef with a more general Cache type, which can hold several PGF grammars. 2008-10-17 14:12:53 +00:00
bjorn
e94cfd8567 Multithreaded gf.fcgi. 2008-10-16 13:00:44 +00:00
bjorn
1919fe99a6 gf-server: the readData function given to getData should be m a, not IO a. 2008-08-24 20:44:30 +00:00
bjorn
f8487ec6b9 Move CGIError stuff to FastCGIUtils. 2008-08-24 19:12:44 +00:00
bjorn
38d37c4149 Added first version of the GF FastCGI server. 2008-08-14 09:06:26 +00:00