Permalink
Browse files

file renaming + added browserify + added js libs

  • Loading branch information...
1 parent c67887d commit 0e0112bc97221efd0526c4144c5cd5844e362822 @gabesoft committed Feb 20, 2012
View
@@ -1 +1 @@
-web: node app.js
+web: node server.js
View
@@ -1,4 +1,4 @@
#!/bin/bash
dir=`dirname $0`
-nodemon --debug $dir/../app.js
+nodemon --debug $dir/../server.js
@@ -0,0 +1,5 @@
+model = require('./model/item.js')
+
+jQuery ->
+ item = new model.Item('hola')
+ console.log 'first item', item.toJSON()
@@ -0,0 +1,12 @@
+(function() {
+ var model;
+
+ model = require('./model/item.js');
+
+ jQuery(function() {
+ var item;
+ item = new model.Item('hola');
+ return console.log('first item', item.toJSON());
+ });
+
+}).call(this);
@@ -0,0 +1,7 @@
+class exports.Item extends Backbone.Model
+ url: '/items'
+ initialize: (text) ->
+ this.set 'date': new Date, 'text': text
+
+
+
Oops, something went wrong.
@@ -10,3 +10,5 @@ port = process.env.PORT or 3000
app.listen port, () ->
console.log("Express server listening on port %d in %s mode", app.address().port, app.settings.env)
+bundle = require('browserify')(__dirname + '/public/javascripts/app.js')
+app.use bundle
@@ -1,5 +1,5 @@
(function() {
- var app, express, port, routes;
+ var app, bundle, express, port, routes;
express = require('express');
@@ -17,4 +17,8 @@
return console.log("Express server listening on port %d in %s mode", app.address().port, app.settings.env);
});
+ bundle = require('browserify')(__dirname + '/public/javascripts/app.js');
+
+ app.use(bundle);
+
}).call(this);
View
@@ -3,5 +3,10 @@ html
head
title= title
link(rel='stylesheet', href='/stylesheets/style.css')
+ script(type='text/javascript', src='javascripts/lib/jquery-1.7.1.js')
+ script(type='text/javascript', src='javascripts/lib/json2.js')
+ script(type='text/javascript', src='javascripts/lib/underscore.js')
+ script(type='text/javascript', src='javascripts/lib/backbone.js')
+ script(type='text/javascript', src='/browserify.js')
body!= body
div= 'go nodemon'

0 comments on commit 0e0112b

Please sign in to comment.