Skip to content
This repository has been archived by the owner on Jul 15, 2019. It is now read-only.

Commit

Permalink
Fixed version number.
Browse files Browse the repository at this point in the history
  • Loading branch information
Joe Catera committed Mar 4, 2014
2 parents 7b2d027 + bedd4db commit be921e4
Show file tree
Hide file tree
Showing 26 changed files with 221 additions and 127 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ You can copy the [built-in](https://github.com/yahoo/mojito-cli-create/tree/mast

If a file in the archetype source ends with `.hb` then the contents of the file will have key/value replacement done for the following:

* `{{port}}` -> default port number 8666 or the value passed by option `--port`
* `{{name}}` -> the name passed as the last command line argument that is not a flag or option, like `--port`. The
* `{{name}}` -> the name passed as the last command line argument that is not a flag or option. The
name is lowercased and used for the module name of mojit code.
* `{{class}}` -> is the sname as `{{name}}` except the value is not lowercased. The value is used for the class name
of mojit code.
Expand Down
37 changes: 37 additions & 0 deletions archetypes/app/default/app.js.hb
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*jslint nomen:true, node:true*/

var express = require('express'),
libmojito = require('mojito'),
app;

app = express();

// Set the port to listen on.
app.set('port', process.env.PORT || {{port}});

// Create a new Mojito instance and attach it to `app`.
// Options can be passed to `extend`.
libmojito.extend(app, {
context: {
environment: "development"
}
});

// Load the built-in middleware or any middleware
// configuration specified in application.json
app.use(libmojito.middleware());



// Load routes configuration from routes.json
app.mojito.attachRoutes();

// Allow anonymyous mojit instances w/ actions to be dispatched
app.get('/:mojit/:action', libmojito.dispatch("{mojit}.{action}"));

app.listen(app.get('port'), function () {
console.log('Server listening on port ' + app.get('port') + ' ' +
'in ' + app.get('env') + ' mode');
});


1 change: 0 additions & 1 deletion archetypes/app/default/application.json.hb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[
{
"settings": [ "master" ],
"appPort": "{{port}}",
"specs": {}
},
{
Expand Down
8 changes: 5 additions & 3 deletions archetypes/app/default/package.json.hb
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
"author": "",
"contributors": [],
"dependencies": {
"mojito": ">0.6"
"express": "3.x",
"mojito": "~0.9"
},
"engines": {
"node": ">0.8"
}
"node": ">=0.8"
},
"main": "./app.js"
}
17 changes: 0 additions & 17 deletions archetypes/app/default/server.js

This file was deleted.

35 changes: 35 additions & 0 deletions archetypes/app/full/app.js.hb
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*jslint nomen:true, node:true*/

var express = require('express'),
libmojito = require('mojito'),
app;

app = express();

// Set the port to listen on.
app.set('port', process.env.PORT || {{port}});

// Create a new Mojito instance and attach it to `app`.
// Options can be passed to `extend`.
libmojito.extend(app, {
context: {
environment: "development"
}
});

// Load the built-in middleware or any middleware
// configuration specified in application.json
app.use(libmojito.middleware());

// Load routes configuration from routes.json
app.mojito.attachRoutes();

// Allow anonymyous mojit instances w/ actions to be dispatched
app.get('/:mojit/:action', libmojito.dispatch("{mojit}.{action}"));

app.listen(app.get('port'), function () {
console.log('Server listening on port ' + app.get('port') + ' ' +
'in ' + app.get('env') + ' mode');
});


1 change: 0 additions & 1 deletion archetypes/app/full/application.json.hb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
{
"settings": [ "master" ],

"appPort": "{{port}}",
"cacheViewTemplates": true,
"staticHandling": {
"appName": "app",
Expand Down
8 changes: 5 additions & 3 deletions archetypes/app/full/package.json.hb
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
"author": "",
"contributors": [],
"dependencies": {
"mojito": ">0.6"
"express": "3.x",
"mojito": "~0.9"
},
"engines": {
"node": ">0.8"
}
"node": ">=0.8"
},
"main": "./app.js"
}
17 changes: 0 additions & 17 deletions archetypes/app/full/server.js

This file was deleted.

35 changes: 35 additions & 0 deletions archetypes/app/simple/app.js.hb
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*jslint nomen:true, node:true*/

var express = require('express'),
libmojito = require('mojito'),
app;

app = express();

// Set the port to listen on.
app.set('port', process.env.PORT || {{port}});

// Create a new Mojito instance and attach it to `app`.
// Options can be passed to `extend`.
libmojito.extend(app, {
context: {
environment: "development"
}
});

// Load the built-in middleware or any middleware
// configuration specified in application.json
app.use(libmojito.middleware());

// Load routes configuration from routes.json
app.mojito.attachRoutes();

// Allow anonymyous mojit instances w/ actions to be dispatched
app.get('/:mojit/:action', libmojito.dispatch("{mojit}.{action}"));

app.listen(app.get('port'), function () {
console.log('Server listening on port ' + app.get('port') + ' ' +
'in ' + app.get('env') + ' mode');
});


1 change: 0 additions & 1 deletion archetypes/app/simple/application.json.hb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[
{
"settings": [ "master" ],
"appPort": "{{port}}",
"specs": {}
},
{
Expand Down
8 changes: 5 additions & 3 deletions archetypes/app/simple/package.json.hb
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
"author": "",
"contributors": [],
"dependencies": {
"mojito": ">0.6"
"express": "3.x",
"mojito": "~0.9"
},
"engines": {
"node": ">0.8"
}
"node": ">=0.8"
},
"main": "./app.js"
}
17 changes: 0 additions & 17 deletions archetypes/app/simple/server.js

This file was deleted.

34 changes: 34 additions & 0 deletions archetypes/app/yahoo/app.js.hb
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*jslint nomen:true, node:true*/

var express = require('express'),
libmojito = require('mojito'),
app;

app = express();

// Set the port to listen on.
app.set('port', process.env.PORT || {{port}});

// Create a new Mojito instance and attach it to `app`.
// Options can be passed to `extend`.
libmojito.extend(app, {
context: {
environment: "development"
}
});

// Load the built-in middleware or any middleware
// configuration specified in application.json
app.use(libmojito.middleware());

// Load routes configuration from routes.json
app.mojito.attachRoutes();

app.listen(app.get('port'), function () {
console.log('Server listening on port ' + app.get('port') + ' ' +
'in ' + app.get('env') + ' mode');
});

module.exports = app;


1 change: 0 additions & 1 deletion archetypes/app/yahoo/application.json.hb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[
{
"settings": [ "master" ],
"appPort": "{{port}}",
"specs": {}
},
{
Expand Down
14 changes: 14 additions & 0 deletions archetypes/app/yahoo/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

/*jslint nomen:true, node:true*/

var http = require('http'),
app = require('./app');

/**
* @token given by manhattan and used to emit that the app is ready
*/
module.exports = function(config, token) {
// send the application to Manhattan along with the token
process.emit("application-ready", token, http.createServer(app));
};

8 changes: 5 additions & 3 deletions archetypes/app/yahoo/package.json.hb
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@
}
],
"dependencies": {
"mojito": ">0.6"
"express": "3.x",
"mojito": "~0.9"
},
"engines": {
"node": ">0.8"
}
"node": ">=0.8"
},
"main": "./app.js"
}
17 changes: 0 additions & 17 deletions archetypes/app/yahoo/server.js

This file was deleted.

34 changes: 34 additions & 0 deletions archetypes/demo/quickstartguide/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*jslint nomen:true, node:true*/

var express = require('express'),
libmojito = require('mojito'),
app;

app = express();

// Set the port to listen on.
app.set('port', process.env.PORT || 8666);

// Create a new Mojito instance and attach it to `app`.
// Options can be passed to `extend`.
libmojito.extend(app, {
context: {
environment: "development"
}
});

// Load the built-in middleware or any middleware
// configuration specified in application.json
app.use(libmojito.middleware());

// Load routes configuration from routes.json
app.mojito.attachRoutes();

app.listen(app.get('port'), function () {
console.log('Server listening on port ' + app.get('port') + ' ' +
'in ' + app.get('env') + ' mode');
});

module.exports = app;


12 changes: 5 additions & 7 deletions archetypes/demo/quickstartguide/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,11 @@ http://devel.corp.yahoo.com/cocktails/mojito/manhattan_reqs_mojito_startup.html#

process.chdir(__dirname);

/*
* Create the MojitoServer instance we'll interact with. Options can be passed
* using an object with the desired key/value pairs.
*/
var Mojito = require('mojito');
var app = Mojito.createServer();
var http = require('http'),
app = require('./app');

module.exports = function(config, token) {
process.emit('application-ready', token, app.getHttpServer());
process.emit('application-ready', token, http.createServer(app));
};


2 changes: 1 addition & 1 deletion archetypes/demo/quickstartguide/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@
},
"dependencies": {
"node-markdown": "*",
"mojito": "*"
"mojito": "~0.9"
}
}
Loading

0 comments on commit be921e4

Please sign in to comment.