ed1t
ed1t

Reputation: 8709

nodejs mustache/handlebars example project

I've been looking to use mustache or handlebars and nodejs but I have't been successful to finding a sample project online that is working.

I just need a sample skeleton structure which uses mustache as a templating engine.

My goal is to use nodejs, mustache/handlebars, less (css framework) and some good routing but haven't been able to find a good example to work off.

UPDATE

I created a project which uses less, mustache and express using some tutorial online but I'm getting an error at startup. app.js at https://gist.github.com/1237758

I'm getting TypeError: Object # has no method 'compile'

I have express, less and mustache in my node_modules.

Upvotes: 3

Views: 7625

Answers (5)

Nate B
Nate B

Reputation: 153

I looked for a Express/Handlebars/Less framework, but couldn't find any templates that I was satisfied with.

I ended up making my own Express/Handlebars/Less project template on GitHub:

Express-Handlebars-Less-Jasmine-NodeUnit_Project-Template

Upvotes: 0

James Kyburz
James Kyburz

Reputation: 14503

As you have already received some answers with regard to templating I thought I would answer the routing one. Try out http://sammyjs.org/ a small web framework written in js.

Also there are some examples https://github.com/quirkey/sammy/tree/master/examples/

Upvotes: 0

LoG
LoG

Reputation: 1141

The source of your error seems to reside in connect module, connect/lib/middleware/compiler.js but I can't reproduce the error. It is possible that you have an old connect module inside your $NODE_PATH

Upvotes: 0

Donnie H
Donnie H

Reputation: 1612

You can use the stache module. It makes it much easier to use mustache in express. Check out the examples.

Upvotes: 3

Related Questions