Skip to content
Browse files

simple example

  • Loading branch information...
1 parent d93b87b commit ffafe4cfefbdde06b0f66b40508bc87f22c6aa86 @substack committed May 27, 2011
Showing with 45 additions and 0 deletions.
  1. +2 −0 example/simple/files/bar.sh
  2. +1 −0 example/simple/files/foo.txt
  3. +27 −0 example/simple/index.html
  4. +15 −0 example/simple/server.js
View
2 example/simple/files/bar.sh
@@ -0,0 +1,2 @@
+#!/bin/bash
+echo bar!
View
1 example/simple/files/foo.txt
@@ -0,0 +1 @@
+This is the foo file!
View
27 example/simple/index.html
@@ -0,0 +1,27 @@
+<html>
+ <head>
+ <script type="text/javascript" src="/browserify.js"></script>
+ <script type="text/javascript">
+ var files = require('files')
+ var $ = require('jquery');
+
+ window.onload = function () {
+ Object.keys(files).forEach(function (name) {
+ var div = $('<div>').appendTo($('#files'));
+
+ $('<div>')
+ .text(name)
+ .appendTo(div)
+ ;
+ $('<textarea>')
+ .val(files[name])
+ .appendTo(div)
+ ;
+ });
+ };
+ </script>
+ </head>
+ <body>
+ <div id="files"></div>
+ </body>
+</html>
View
15 example/simple/server.js
@@ -0,0 +1,15 @@
+var express = require('express');
+var app = express.createServer();
+
+app.use(express.static(__dirname));
+app.listen(8080);
+console.log('Listening on 8080');
+
+var browserify = require('browserify');
+var bundle = browserify({
+ require : { jquery : 'jquery-browserify' }
+});
+app.use(bundle);
+
+var browserifyFile = require('browserify-file');
+bundle.use(browserifyFile('files', __dirname + '/files'));

0 comments on commit ffafe4c

Please sign in to comment.
Something went wrong with that request. Please try again.