Skip to content

Instantly share code, notes, and snippets.

@carlos8f
Last active December 22, 2015 16:39
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save carlos8f/6500937 to your computer and use it in GitHub Desktop.
Save carlos8f/6500937 to your computer and use it in GitHub Desktop.
motley gist template
node_modules
npm-debug.log
port: 3000
var app = require('motley');
module.exports = app.controller()
.get('/', function (req, res, next) {
res.vars.title = 'Gist';
res.render('index');
})
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta charset="utf-8">
<title>{{title}}</title>
<link rel="stylesheet" href="http://yui.yahooapis.com/pure/0.2.1/pure-min.css">
<link rel="stylesheet" href="/style.css">
</head>
<body>
{{{content}}}
</body>
</html>
{
"name": "motley-gist",
"version": "0.0.0",
"description": "ERROR: No README data found!",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"dependencies": {
"motley": "~0.5.7"
}
}
var app = require('motley');
app.boot(function (err) {
if (err) throw err;
app.motley();
app.router.add(require('./controller').handler);
app.server.listen(app.conf.port, function () {
console.log('server listening on port', app.server.address().port);
});
});
body {
padding: 3em;
font-size: 120%;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment