arcannon / fundation

Fun and simple way to build a site

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

Fun and simple way to build a site

License:MIT License


Languages

Language:JavaScript 86.2%Language:CSS 13.8%