Skip to content

Commit

Permalink
initial router with two very simple modules to later handle auth and …
Browse files Browse the repository at this point in the history
…static content hosting
  • Loading branch information
Chris Raynor committed Dec 23, 2013
1 parent 891b08c commit 6b18b57
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
.DS_Store
25 changes: 25 additions & 0 deletions bin/firebase
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env node

var optimist = require('optimist'),
argv = optimist.usage('Usage: firebase (auth|app)').argv,
app = require('../lib/app')
auth = require('../lib/auth');

if (argv._.length === 0) {

// Require at least one non-hyphenated option
optimist.showHelp();

} else {
// Router
switch (argv._[0]) {
case 'app':
app(argv);
break;
case 'auth':
auth(argv);
break;
default:
optimist.showHelp();
}
}
5 changes: 5 additions & 0 deletions lib/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = app;

function app(argv) {
console.log('app', argv);
}
5 changes: 5 additions & 0 deletions lib/auth.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = auth;

function auth(argv) {
console.log('auth', argv);
}
22 changes: 22 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": "firebase-cli",
"preferGlobal": true,
"version": "0.0.1",
"description": "The Firebase command line interface",
"keywords": [
"firebase"
],
"author": "Firebase <support@firebase.com>",
"contributors": [{
"name": "Chris Raynor",
"email": "chris@firebase.com"
}],
"repository": "https://github.com/firebase/firebase-cli.git",
"homepage": "https://github.com/firebase/firebase-cli",
"dependencies": {
"optimist": "0.6.x"
},
"bin": {
"firebase": "./bin/firebase"
}
}

0 comments on commit 6b18b57

Please sign in to comment.