Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

basic workspace setup

  • Loading branch information...
commit f57239b230ec649a2177d9f598cff508caa895f5 0 parents
@cadorn cadorn authored
87 README.md
@@ -0,0 +1,87 @@
+FirePHP 1.0
+===========
+
+Status: dev
+
+This project contains the FirePHP 1.0 PHP server library and provides a development environment for working on FirePHP.
+
+The [PINF JavaScript Loader](https://github.com/pinf/loader-js) is used to provide a development environment and package releases for this project.
+
+**NOTE:** It is assumed you have the _PINF JavaScript Loader_ mapped to the `commonjs` command and are using the `node` platform by default as explained [here](https://github.com/pinf/loader-js/blob/master/docs/Setup.md).
+
+Demo
+====
+
+ commonjs -v https://github.com/firephp/firephp
+
+
+Development
+===========
+
+ git clone git://github.com/firephp/firephp.git
+ cd firephp
+ commonjs -v ./
+
+
+Support & Feedback
+==================
+
+Mailing list: [http://groups.google.com/group/firephp-dev](http://groups.google.com/group/firephp-dev)
+
+
+Contribute
+==========
+
+Collaboration Platform: [https://github.com/firephp/firephp/](https://github.com/firephp/firephp/)
+
+Collaboration Process:
+
+ 1. Send message to discuss your change
+ 2. Write a patch on your own
+ 3. Send pull request on github
+ 4. Discuss pull request on github to refine
+
+You must explicitly license your patch by adding the following to the top of any file you modify
+in order for your patch to be accepted:
+
+ // - <GithubUsername>, First Last <Email>, Copyright YYYY, MIT License
+
+
+Author
+======
+
+This project is maintained by [Christoph Dorn](http://www.christophdorn.com/).
+
+
+Documentation License
+=====================
+
+[Creative Commons Attribution-NonCommercial-ShareAlike 3.0](http://creativecommons.org/licenses/by-nc-sa/3.0/)
+
+Copyright (c) 2007+ [Christoph Dorn](http://www.christophdorn.com/)
+
+
+Code License
+============
+
+[MIT License](http://www.opensource.org/licenses/mit-license.php)
+
+Copyright (c) 2007+ [Christoph Dorn](http://www.christophdorn.com/)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
5 program.json
@@ -0,0 +1,5 @@
+{
+ "extends": {
+ "location": "./workspace/program.json"
+ }
+}
73 workspace/lib/project.js
@@ -0,0 +1,73 @@
+
+var host = "localhost",
+ port = 8003;
+
+var CONNECT = require("connect/connect"),
+ PATH = require("nodejs/path"),
+ PROMISE = require("jsgi/promise"),
+ PROGRAM_SERVER = require("pinf/program-server");
+
+exports.main = function()
+{
+ module.print("\n\0cyan(\0bold(Welcome to the project server for the FirePHP project!\0)\0)\n\n");
+ module.print("\0yellow(\0bold(Use your browser to navigate to: " + "http://" + host + ":" + port + "/" + "\0)\0)\n\n");
+
+ CONNECT()
+ .use('/', CONNECT.static(PATH.dirname(PATH.dirname(module.id)) + "/www", {
+ maxAge: 0
+ }))
+ .listen(port);
+}
+
+// TODO: This should move to https://github.com/senchalabs/connect/blob/master/lib/middleware/jsgi.js
+var jsgi = function jsgi(app, options)
+{
+ options = options || {};
+
+ return function(req, res, next)
+ {
+ var env = {
+ pathInfo: req.originalUrl,
+ port: port, // TODO: This should come from req
+ host: host // TODO: This should come from req
+ };
+
+ var data = app(env);
+
+ if (typeof data == "object")
+ {
+ if (typeof data.then == "function")
+ {
+ function handle(data)
+ {
+ res.statusCode = data.status;
+ for (var name in data.headers)
+ {
+ // TODO: Camelcase names
+ res.setHeader(name, data.headers[name]);
+ }
+ res.end(data.body.join(""));
+ }
+ data.then(
+ handle,
+ function (error)
+ {
+ module.print("Error: " + error.stack);
+ handle({ status:500, headers:{}, body:[error.message] });
+ },
+ function (data)
+ {
+ throw new Error("NYI");
+ // @see https://github.com/kriszyp/jsgi-node/blob/v0.2.4/lib/jsgi-node.js#L128
+ // TODO: handle(data, true);
+ }
+ );
+ return;
+ }
+ else
+ throw new Error("NYI");
+ }
+ else
+ throw new Error("NYI");
+ }
+}
21 workspace/package.json
@@ -0,0 +1,21 @@
+{
+ "name": "firephp",
+ "engine": [
+ "node"
+ ],
+ "main": "lib/project.js",
+ "mappings": {
+ "nodejs": {
+ "id": "nodejs.org"
+ },
+ "pinf": {
+ "id": "pinf.org/loader"
+ },
+ "jsgi": {
+ "id": "github.com/kriszyp/jsgi-node/"
+ },
+ "connect": {
+ "id": "github.com/senchalabs/connect/"
+ }
+ }
+}
66 workspace/program.json
@@ -0,0 +1,66 @@
+{
+ "boot": "workspace",
+ "engine": [
+ "node"
+ ],
+ "packages": {
+ "workspace": {
+ "locator": {
+ "location": "./"
+ }
+ },
+ "nodejs.org": {
+ "provider": "nodejs.org"
+ },
+ "pinf.org/loader": {
+ "provider": "pinf.org/loader"
+ },
+ "github.com/kriszyp/jsgi-node/": {
+ "locator": {
+ "archive": "https://github.com/kriszyp/jsgi-node/zipball/v0.2.4",
+ "descriptor": {
+ "uid": "https://github.com/kriszyp/jsgi-node/",
+ "native": true
+ }
+ }
+ },
+ "github.com/senchalabs/connect/": {
+ "locator": {
+ "archive": "https://github.com/senchalabs/connect/zipball/master",
+ "descriptor": {
+ "uid": "http://github.com/senchalabs/connect/",
+ "native": true,
+ "dependencies": [
+ {
+ "id": "registry.npmjs.org/qs/"
+ },
+ {
+ "id": "github.com/bentomas/node-mime/"
+ }
+ ]
+ }
+ }
+ },
+ "registry.npmjs.org/qs/": {
+ "locator": {
+ "archive": "http://registry.npmjs.org/qs/-/qs-0.0.6.tgz",
+ "descriptor": {
+ "uid": "http://registry.npmjs.org/qs/",
+ "native": true
+ }
+ }
+ },
+ "github.com/bentomas/node-mime/": {
+ "locator": {
+ "archive": "https://github.com/bentomas/node-mime/zipball/master",
+ "descriptor": {
+ "uid": "https://github.com/bentomas/node-mime/",
+ "native": true,
+ "directories": {
+ "lib": ""
+ }
+ }
+ }
+ }
+ }
+}
1  workspace/www/index.html
@@ -0,0 +1 @@
+Welcome to the FirePHP project!
Please sign in to comment.
Something went wrong with that request. Please try again.