-
-
Save wmayner/306c89d7f8fbeed3f098 to your computer and use it in GitHub Desktop.
This throws an ` Error: Cannot find module 'hogan' `
when a request is made.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Module dependencies. | |
express = require 'express' | |
http = require 'http' | |
path = require 'path' | |
colors = require 'colors' | |
engines = require 'consolidate' | |
engine = 'hogan' | |
app = express() | |
app.configure () -> | |
app.use express.logger('dev') | |
app.set 'port', process.env.PORT || 8080 | |
app.engine 'html', engines[engine] | |
app.set 'view engine', engine | |
app.set 'views', __dirname + '/views' | |
app.use express.favicon(path.join(__dirname, '/public/img/favicon.ico')) | |
app.use express.bodyParser() | |
app.use express.methodOverride() | |
app.use app.router | |
app.use express.static(path.join(__dirname, '/public')) | |
app.configure 'development', () -> | |
app.use express.errorHandler | |
dumpExceptions: true | |
showStack: true | |
app.get '/', (req, res) -> | |
res.render 'index' | |
app.listen app.get 'port' | |
console.log "Express server listening on port #{app.get 'port'}".green.inverse |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The bug is on line 14. The first argument to
app.engine
must be the file extension your using for templates (just likeapp.set 'view engine', <template_extension>
, which in my case ishogan
, nothtml
. -__________-