Skip to content

Instantly share code, notes, and snippets.

@quentar
Created November 2, 2014 23:45
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 quentar/2f5adfa7046082105efa to your computer and use it in GitHub Desktop.
Save quentar/2f5adfa7046082105efa to your computer and use it in GitHub Desktop.
node-cgi script with absolute paths - mac os x server 10.9.4
#!/usr/bin/env /usr/local/bin/node
/*jshint node: true */
/* had to change path to be absolute , mac os x server 10.9.4 (had to also enable CGI on apache settings)*/
'use strict';
var Processor = require('/usr/local/lib/node_modules/node-cgi/lib/Processor');
var filename = process.env.PATH_TRANSLATED;
var options = {
defaultType: 'js',
typeByExt: {
'.jade.nd': 'jade',
'.html.nd': 'html'
}
};
Processor.processFile(filename, options).toStdout();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment