×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Javascript
Posted by: Paul Allies Allies
Added: Jul 12, 2012 7:39 AM
Modified: Sep 11, 2012 5:57 PM
Views: 194
Tags: no tags
  1. "use strict";
  2. var express = require('express');
  3. var port = process.env.PORT || 8000;
  4. var app = express().listen(port);
  5.  
  6. app.configure(function(){
  7.     app.register('.hbs', require('handlebars'));
  8.     app.set('views',__dirname + '/views');
  9.     app.set('view engine', 'hbs');
  10.     app.use(express.bodyParser());
  11.     app.use(express.cookieParser());
  12.     app.use(express.static(__dirname + '/public'));
  13. });
  14.  
  15. app.get('/', function(req, res){
  16.         res.render("home/index");
  17. });
  18.  
  19. app.get('/email', function(req, res){
  20.         res.render("email/index");
  21. });
  22.  
  23. app.get('/contact', function(req, res){
  24.         res.render("contact/index");
  25. });
  26.