Skip to content
Permalink
Browse files

Now there's Jade.

  • Loading branch information...
Zemke
Zemke committed Dec 10, 2014
1 parent f856e31 commit bd5be3e3d0dbc498d234e0e04c436aa17a737f1c
@@ -6,8 +6,15 @@ module.exports = function(app) {

// frontend routes =========================================================
// route to handle all angular requests
app.get('*', function(req, res) {
res.sendfile('./public/index.html');
app.all('/*', function(req, res, next) {
if (req.url.split('/')[1] !== 'views') {
res.render('index');
} else {
next();
}
});

app.get('/views/:partial', function(req, res, next) {
res.render('views/' + req.params.partial);
});
};
@@ -5,7 +5,7 @@
"express" : "~4.5.1",
"mongoose" : "~3.8.0",
"body-parser" : "~1.4.2",
"method-override" : "~2.0.2"
"method-override" : "~2.0.2",
"jade": "~1.8.1"
}
}

This file was deleted.

@@ -0,0 +1,28 @@
doctype html
html(lang='en')
head
meta(charset='UTF-8')
base(href='/')
title Starter Node and Angular
link(rel='stylesheet', href='libs/bootstrap/dist/css/bootstrap.min.css')
link(rel='stylesheet', href='css/style.css')
script(src='libs/angular/angular.min.js')
script(src='libs/angular-route/angular-route.min.js')
script(src='js/controllers/MainCtrl.js')
script(src='js/controllers/NerdCtrl.js')
script(src='js/services/NerdService.js')
script(src='js/controllers/GeekCtrl.js')
script(src='js/services/GeekService.js')
script(src='js/appRoutes.js')
script(src='js/app.js')
body(ng-app='sampleApp', ng-controller='NerdController')
.container
nav.navbar.navbar-inverse
.navbar-header
a.navbar-brand(href='/') Stencil: Node and Angular
ul.nav.navbar-nav
li
a(href='/nerds') Nerds
li
a(href='/geeks') Geeks
div(ng-view='')
@@ -4,17 +4,17 @@ angular.module('appRoutes', []).config(['$routeProvider', '$locationProvider', f

// home page
.when('/', {
templateUrl: 'views/home.html',
templateUrl: 'views/home',
controller: 'MainController'
})

.when('/nerds', {
templateUrl: 'views/nerd.html',
templateUrl: 'views/nerd',
controller: 'NerdController'
})

.when('/geeks', {
templateUrl: 'views/geek.html',
templateUrl: 'views/geek',
controller: 'GeekController'
});

This file was deleted.

@@ -0,0 +1,3 @@
.jumbotron.text-center
h1 Geek City
p {{tagline}}

This file was deleted.

@@ -0,0 +1,3 @@
.jumbotron.text-center
h1 Home Page 4 Life
p {{tagline}}

This file was deleted.

@@ -0,0 +1,3 @@
.jumbotron.text-center
h1 Nerds and Proud
p {{tagline}}
@@ -4,6 +4,7 @@ var app = express();
var mongoose = require('mongoose');
var bodyParser = require('body-parser');
var methodOverride = require('method-override');
var path = require('path');

// configuration ===========================================

@@ -21,6 +22,9 @@ app.use(bodyParser.urlencoded({ extended: true })); // parse application/x-www-f
app.use(methodOverride('X-HTTP-Method-Override')); // override with the X-HTTP-Method-Override header in the request. simulate DELETE/PUT
app.use(express.static(__dirname + '/public')); // set the static files location /public/img will be /img for users

app.set('views', path.join(__dirname, '/public'));
app.set('view engine', 'jade');

// routes ==================================================
require('./app/routes')(app); // pass our application into our routes

0 comments on commit bd5be3e

Please sign in to comment.
You can’t perform that action at this time.