Skip to content

Instantly share code, notes, and snippets.

@rgchris
Created May 21, 2017 20:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rgchris/0eb5772dafa7e5c8fb77f5c24edbf236 to your computer and use it in GitHub Desktop.
Save rgchris/0eb5772dafa7e5c8fb77f5c24edbf236 to your computer and use it in GitHub Desktop.
Possible implementation of CGI with Ren-C HTTPD module.
#!/usr/local/bin/ren-c
Rebol [
Title: "CGI Tester"
Date: 21-May-2017
Author: "Christopher Ross-Gill"
]
import <httpd>
ws: open [
scheme: 'httpd 8080 [
probe request/action
set-env "PATH_INFO" request/action
; ... SET-ENV other CGI variables ...
response/type: "text/plain"
call/output "./cgi-test-script.r" response/content: make string! 0
]
]
wait ws
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment