Skip to content

Commit

Permalink
node script, less and cs dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
guybedford authored and guybedford committed Nov 28, 2012
1 parent 7207e0c commit aff6540
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 3 deletions.
7 changes: 5 additions & 2 deletions package.json
Expand Up @@ -13,7 +13,10 @@
"dependencies": {
"require": "jrburke/requirejs",
"zest": "zestjs/zest",
"jquery": "github:jquery/jquery/1.8.3"
"jquery": "github:jquery/jquery/1.8.3",
"empty": "guybedford/empty-module",
"require-less": "guybedford/require-less",
"cs": "jrburke/require-cs"
}
}
}
}
2 changes: 1 addition & 1 deletion www/app/Hello/hello.coffee
@@ -1,4 +1,4 @@
define ['zest', 'jquery', 'css!./hello'], ($z, $) ->
define ['zest', 'jquery', 'less!./hello'], ($z, $) ->
options:
name: ' to ZestJS'
render: (o) -> """
Expand Down
File renamed without changes.
50 changes: 50 additions & 0 deletions ~node-server.coffee
@@ -0,0 +1,50 @@
connect = require 'connect'
zest = require 'zest-server'

###
* ZestJS NodeJS Server Example
*
*
* For more info, and configuration options such as how to alter
* client code paths, and disable Zest Server file serving, see:
* http://zestjs.org/docs#Using%20Zest%20Server%20within%20a%20NodeJS%20Application
*
###


app = connect()

zest.init 'dev', ->
app.use zest.server
app.listen 8080



###
# Native ZestJS example:
zest = require 'zest-server'
http = require 'http'
zest.init 'dev', ->
zest.require ['zoe'], (zoe) ->
handler = zoe.fn 'ASYNC'
# custom handler - if it doesn't call 'next'
# then zest won't do routing
handler.on (req, res, next) ->
if someCondition
return next();
# custom render call
zest.renderPage
title: 'Page Title'
structure: 'my/component/id'
options: {}
handler.on zest.server
http.createServer(handler).listen 8085
###

0 comments on commit aff6540

Please sign in to comment.