Skip to content

Instantly share code, notes, and snippets.

@carlos8f
Created June 13, 2014 06:31
Show Gist options
  • Select an option

  • Save carlos8f/e85299372c42ea5df985 to your computer and use it in GitHub Desktop.

Select an option

Save carlos8f/e85299372c42ea5df985 to your computer and use it in GitHub Desktop.
my-project
node_modules
npm-debug.log
db

new motley gist

To run,

$ npm install -g motley
$ motley
module.exports = function (app) {
return app.controller()
.get('/', function (req, res, next) {
res.render('index');
})
};
<h1>{{title}}</h1>
<p>Edit me at <code>{{dir}}/index.hbs</code></p>
module.exports = function (app) {
return app.collection({
name: 'items'
});
};
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>{{title}}</title>
<link rel="stylesheet" href="/style.css">
<link rel="icon" type="image/png" href="/motley.png">
</head>
<body>
{{> messages}}
{{{content}}}
</body>
</html>
{{#if messages}}
{{#each messages}}
<div class="message {{type}}">{{message}}</div>
{{/each}}
{{/if}}
afterware: "*_afterware.js"
collections: "*_collection.js"
controllers: "*_controller.js"
middleware: "*_middleware.js"
plugins: "*_plugin.js"
public: "*.css"
views: "*.hbs"
port: 3000
title: new motley gist
body {
font-family: Helvetica, sans-serif;
padding: 50px;
font-size: 1.1em;
}
input, textarea {
font-family: Helvetica, sans-serif;
padding: 10px;
font-size: 1em;
}
a {
color: #e00;
text-decoration: none;
}
.success {
color: green;
}
.error {
color: red;
}
code {
background-color: #eee;
color: #555;
padding: 0 5px 0 5px;
border-radius: 5px;
}
module.exports = function (app) {
return function (req, res, next) {
res.vars.title = app.conf.title;
res.vars.dir = app.dir;
next();
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment