CoffeeScript React component view engine for Express to create isomorphic applications.
- CoffeeScript ~1.9.0
- React ~0.13.3
npm install express-cjsx
{createEngine} = require 'express-cjsx'
app = do express
app.set 'view engine', 'cjsx'
app.engine 'cjsx', do createEngine
Optional: Passing options
{createEngine} = require 'express-cjsx'
app = do express
app.set 'view engine', 'cjsx'
app.engine 'cjsx', createEngine extension: '.react.coffee'
Option | Values | Default |
---|---|---|
extension |
Any file name extension with leading dot (i.e .cjsx ) |
".cjsx"
|
beautify |
Beautify HTML markup, may affect performance | `false |
doctype |
Any valid doctype, defaults to HTML5. | "<!DOCTYPE html>"
|