fgnass / gateway Goto Github PK
View Code? Open in Web Editor NEWNode.js middleware to execute CGI scripts
Node.js middleware to execute CGI scripts
Awesome plugin! I have found a bug on windows.
On Windows when using node >= v0.10.26, node will parse ['c:\mypath'] into 'c:\mypath'.
Example:
var path = 'c:\windows\system';
console.log(path); // 'c:\windows\system'
console.log([path]); // 'c:\\windows\\system' Node automatically adds \ delimiter
This results in your path.indexOf(docroot) to compare a delimited string with a non delimited string, thus always failing
'c:\\windows\\system'.indexOf('c:\windows\system');
I am going to do a pull request with this simple fix, create an array with docroot and get the string out of the array :
// array then index 0 is a windows filesytem fix please do not remove!
path.indexOf([docroot][0])
Hi,
I followed http://fgnass.github.com/2012/08/30/yeoman.html but I think some documentation is missing.
How did you modify yeoman so that it handle php files? I believe yeoman/tasks/server.js needs to be modified but how?
I'm sure this node module works great, and the instructions for installing the prerequisites is there ok, but I for one am having serious difficulty figuring out how I am supposed to use this to modify Yeoman's built-in server task to serve up PHP files. I tried it after installing and no joy, so I assume I may have to make some changes in the Gruntfile, but figuring what changes need to be made (alias the server task, perhaps?), is pretty opaque.
Is there any chance of some more complete documentation on how to make this work with Yeoman, please?
Cheers
D
Hi, i wonder whehter if this gateway could serve a single entry point?If a request uri is not a real path on server,should it rewrite to the 'index.php'?That means we should check the existment of 'docroot + url.pathname' in the function 'resolveIndexFiles',it may be a file or a directory,if do not exist,rewrite to the 'index.php'.
I try to add in my Path , but it doesn't work -.-'
I don't know how I can do to run in Windows u_u
In linux I just ran sudo apt-get install php5-cgi and it worked , but in Windows , I don't know.
How can I do it ?
I am using gateway in my Grunt-based app for tiny PHP script execution like this but have not view PHP errors in console after 'watch' task runned.
When using a rewrite middleware upstream of the gateway handler, the requested may differ from the req.url
. You could potentially use req.originalUrl
when setting the REQUEST_URI environment variable so it accurately reflects the requested URL rather than the rewritten request.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.