Permalink
Browse files

initial commit

  • Loading branch information...
kirbysayshi committed Sep 18, 2012
0 parents commit cb3137cd58214ba64294d99958edb1d236456d0d
Showing with 111 additions and 0 deletions.
  1. +34 −0 app.js
  2. +12 −0 package.json
  3. +8 −0 public/stylesheets/style.css
  4. +15 −0 routes/index.js
  5. +17 −0 views/hours.vash
  6. +10 −0 views/index.vash
  7. +15 −0 views/layout.vash
34 app.js
@@ -0,0 +1,34 @@
+
+/**
+ * Module dependencies.
+ */
+
+var express = require('express')
+ , routes = require('./routes')
+ , user = require('./routes/user')
+ , http = require('http')
+ , path = require('path');
+
+var app = express();
+
+app.configure(function(){
+ app.set('port', process.env.PORT || 3000);
+ app.set('views', __dirname + '/views');
+ app.set('view engine', 'vash');
+ app.use(express.favicon());
+ app.use(express.logger('dev'));
+ app.use(express.bodyParser());
+ app.use(express.methodOverride());
+ app.use(app.router);
+ app.use(express.static(path.join(__dirname, 'public')));
+});
+
+app.configure('development', function(){
+ app.use(express.errorHandler());
+});
+
+app.get('/', routes.index);
+
+http.createServer(app).listen(app.get('port'), function(){
+ console.log("Express server listening on port " + app.get('port'));
+});
@@ -0,0 +1,12 @@
+{
+ "name": "application-name",
+ "version": "0.0.1",
+ "private": true,
+ "scripts": {
+ "start": "node app"
+ },
+ "dependencies": {
+ "express": "3.0.0rc4",
+ "vash": "0.5"
+ }
+}
@@ -0,0 +1,8 @@
+body {
+ padding: 50px;
+ font: 14px "Lucida Grande", Helvetica, Arial, sans-serif;
+}
+
+a {
+ color: #00B7FF;
+}
@@ -0,0 +1,15 @@
+
+/*
+ * GET home page.
+ */
+
+exports.index = function(req, res){
+ res.render('index', {
+ title: 'Express'
+ ,reasons: [
+ "Razor Syntax"
+ ,"Still HTML"
+ ,"You can macro your macros into your macros, if you want"
+ ]
+ });
+};
@@ -0,0 +1,17 @@
+<ol class="reasons">
+ @model.forEach(function(reason){
+ <li>@reason</li>
+ })
+</ol>
+
+@html.prepend('footer', function(model){
+ <text>This is a footer. </text>
+})
+
+@html.block('footer', function(){
+ <text>It's followed by primary content replaced from deep within. </text>
+})
+
+@html.append('footer', function(model){
+ <text>Aren't blocks fun? It's the last. </text>
+})
@@ -0,0 +1,10 @@
+@html.extends('layout', function(model){
+
+ @html.block('content', function(model){
+ <h1 class="name">Welcome to @model.title</h1>
+ <p>Thanks for looking at Vash!</p>
+
+ @html.include('hours', model.reasons)
+ })
+
+})
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8">
+ <title>@model.title</title>
+ <link rel="stylesheet" href="stylesheets/style.css" type="text/css" media="screen" charset="utf-8">
+ </head>
+ <body>
+ @html.block('content')
+
+ <footer>
+ @html.block('footer')
+ </footer>
+ </body>
+</html>

0 comments on commit cb3137c

Please sign in to comment.