Skip to content

Latest commit

 

History

History
59 lines (44 loc) · 838 Bytes

README.md

File metadata and controls

59 lines (44 loc) · 838 Bytes

Fundation

A fun and simple way to build a site.

var fundation = require('fundation');
var app = require('express')();

app.use(fundation.init());

app.listen(8080)

Installation

$ npm install fundation

Models

module.exports = function(app) {
  return {
    get: function (slug) {
      return {
        title: "My Title",
        description: "Bacon ipsum dolor frankfurter ham"
      }
    }
  };
};

Controllers

var article = require('fundation').model.article;

module.exports = function (app) {
  app.route('/article/:slug')
    .get(function (req, res, next) {
      res.render('article.swig', {
        article: article.get(req.params.slug)
    });
  });
};

Views

<h1>{{ article.title }}</h1>
<p>{{ article.description }}</p>

License

MIT