Permalink
Browse files

Initial commit

  • Loading branch information...
0 parents commit c7feedbd19e77cde0d12228f918c34bb999a0508 @ajlopez committed Dec 31, 2012
Showing with 147 additions and 0 deletions.
  1. +1 −0 .gitignore
  2. +1 −0 .npmignore
  3. +23 −0 LICENSE
  4. +45 −0 README.md
  5. +6 −0 lib/simpleweb.js
  6. +16 −0 package.json
  7. +54 −0 test.js
  8. +1 −0 test/simple.js
@@ -0,0 +1 @@
+node_modules
@@ -0,0 +1 @@
+/samples
23 LICENSE
@@ -0,0 +1,23 @@
+
+Copyright (C) 2012, 2013, Angel J Lopez
+http://www.ajlopez.com
+http://ajlopez.wordpress.com
+http://twitter.com/ajlopez
+
+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.
@@ -0,0 +1,45 @@
+# SimpleWeb
+
+Simple Web Application using middleware, inspired by Connect and others. Work in Progress.
+
+## Installation
+
+Via npm using (Node.js)[http://nodejs.org]:
+```
+npm install simpleweb
+```
+
+## Usage
+
+Reference in your program:
+```js
+var simpleweb = require('simpleweb');
+```
+TBD
+
+## Development
+
+```
+git clone git://github.com/ajlopez/SimpleWeb.git
+cd SimpleWeb
+npm install
+npm test
+```
+
+## Samples
+
+TBD
+
+## To do
+
+TBD
+
+## Contribution
+
+Feel free to [file issues](https://github.com/ajlopez/SimpleWeb) and submit
+[pull requests](https://github.com/ajlopez/SimpleWeb/pulls) — contributions are
+welcome.
+
+If you submit a pull request, please be sure to add or update corresponding
+test cases, and ensure that `npm test` continues to pass.
+
@@ -0,0 +1,6 @@
+'use strict';
+
+exports = module.exports = createApplication;
+
+function createApplication() {
+};
@@ -0,0 +1,16 @@
+{ "name": "simpleweb"
+, "description": "Simple Web Application using middleware"
+, "keywords": [ "http", "web", "application", "middleware" ]
+, "version": "0.0.1alpha"
+, "author": "Angel 'Java' Lopez <webmaster@ajlopez.com> (http://www.ajlopez.com)"
+, "repository": { "type": "git", "url": "git://github.com/ajlopez/SimpleWeb.git" }
+, "main": "./lib/simpleweb.js"
+, "engines": { "node": ">= 0.6.0 && < 0.9.0" }
+, "scripts": {
+ "test": "node ./test.js"
+ }
+, "dependencies": {
+ }
+, "devDependencies": {
+ }
+}
54 test.js
@@ -0,0 +1,54 @@
+#!/usr/bin/env node
+
+// Based on https://github.com/laverdet/node-fibers/blob/master/test.js
+
+var fs = require('fs');
+var spawn = require('child_process').spawn;
+var path = require('path');
+
+function runTest(test, cb) {
+ var proc = spawn(process.execPath, [path.join('test', test)], {env: {NODE_PATH: __dirname}});
+ proc.stdout.setEncoding('utf8');
+ proc.stderr.setEncoding('utf8');
+
+ var stdout = '', stderr = '';
+ proc.stdout.on('data', function(data) {
+ stdout += data;
+ });
+ proc.stderr.on('data', function(data) {
+ stderr += data;
+ });
+ proc.stdin.end();
+
+ proc.on('exit', function(code) {
+ if ((stdout !== 'pass\n' && stdout !== '') || stderr !== '') {
+ return cb(new Error(
+ 'Test `'+ test+ '` failed.\n'+
+ 'code: '+ code+ '\n'+
+ 'stderr: '+ stderr+ '\n'+
+ 'stdout: '+ stdout));
+ }
+ console.log(test+ ': '+ 'pass');
+ cb();
+ });
+}
+
+var cb = function(err) {
+ if (err) {
+ console.error(String(err));
+ process.exit(1);
+ }
+};
+fs.readdirSync('./test').reverse().forEach(function(file) {
+ var stats = fs.lstatSync(path.join('./test',file));
+ if (!stats.isFile())
+ return;
+
+ cb = new function(cb, file) {
+ return function(err) {
+ if (err) return cb(err);
+ runTest(file, cb);
+ };
+ }(cb, file);
+});
+cb();

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

0 comments on commit c7feedb

Please sign in to comment.