Skip to content

Commit

Permalink
added support for CoffeeScript controllers
Browse files Browse the repository at this point in the history
  • Loading branch information
John Le Drew committed Apr 7, 2012
1 parent 834c73b commit a1e71ee
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
3 changes: 1 addition & 2 deletions example/base.js
Expand Up @@ -7,5 +7,4 @@ var base = new Base({
port: 8000
});

base.go()

base.go()
2 changes: 1 addition & 1 deletion example/controllers/index.js
Expand Up @@ -2,4 +2,4 @@ exports.index = function(req,res,callback) {
callback({
'title' : 'Hello world!'
});
}
}
3 changes: 2 additions & 1 deletion src/lib/base.coffee
Expand Up @@ -37,6 +37,7 @@ class Base extends EventEmitter
models: "/models",
public: "/public",
template_engine: "jqtpl",
core_language: "js",
port: 3000
})

Expand Down Expand Up @@ -99,7 +100,7 @@ class Base extends EventEmitter
callback null

controller: (callback) =>
target = "#{@options.root}#{@options.controllers}/#{req.controller}.js"
target = "#{@options.root}#{@options.controllers}/#{req.controller}.#{@options.core_language}"

fs.stat target, (err) =>
if (err) then return callback(null)
Expand Down

0 comments on commit a1e71ee

Please sign in to comment.