Skip to content
Browse files

Working on installer, geddy-gen.

  • Loading branch information...
1 parent 51f527f commit 140ad66ec5fed55471e7ee1d27606a573506628f mde committed
Showing with 38 additions and 3 deletions.
  1. +7 −0 Makefile
  2. +3 −0 base/geddy
  3. +9 −0 base/geddy-gen
  4. +1 −1 base/router.js
  5. +16 −0 base/runserv.js
  6. +1 −1 lib/config.js
  7. +1 −1 lib/router.js
View
7 Makefile
@@ -0,0 +1,7 @@
+.PHONY: all install
+
+all: install
+
+install:
+ mkdir -p ~/.node_libraries/geddy; cp -R lib ~/.node_libraries/geddy/; cp -R base ~/.node_libraries/geddy/; cp base/geddy-gen /usr/local/bin/; cp base/geddy /usr/local/bin/
+
View
3 base/geddy
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+node ~/.node_libraries/geddy/base/runserv.js `pwd`
View
9 base/geddy-gen
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+if [ $1 = 'app' ]; then
+ mkdir $2
+ mkdir $2/config
+ cp ~/.node_libraries/geddy/base/router.js $2/config/
+ mkdir -p $2/app/controllers
+ mkdir $2/public
+fi
View
2 base/router.js
@@ -1,4 +1,4 @@
-var Router = require('../framework/router').Router;
+var Router = require('geddy/lib/router').Router;
router = new Router();
router.match('/').to({controller: 'Main', action: 'index'});
View
16 base/runserv.js
@@ -0,0 +1,16 @@
+var sys = require('sys');
+var http = require('http');
+var Config = require('geddy/lib/config').Config;
+var App = require('geddy/lib/app').App;
+var appDirname = process.argv[2];
+
+config = new Config(appDirname);
+
+http.createServer(function (req, resp) {
+ new App(config).run(req, resp);
+}).listen(8000);
+
+
+sys.puts('Server running at http://127.0.0.1:8000/');
+
+
View
2 lib/config.js
@@ -1,5 +1,5 @@
var fs = require('fs');
-var fleegix = require('./fleegix');
+var fleegix = require('geddy/lib/fleegix');
var environments = {
DEVELOPMENT: 'development',
View
2 lib/router.js
@@ -1,4 +1,4 @@
-var fleegix = require('./fleegix');
+var fleegix = require('geddy/lib/fleegix');
var sys = require('sys');
/*

0 comments on commit 140ad66

Please sign in to comment.
Something went wrong with that request. Please try again.