Permalink
Browse files

Add a documentation page.

It makes no sense to deploy this without documentation, so I made the / be a
simple "this is how you do it".

This meant that I needed to change the endpoint for the combo loader to work
at.  It's now at /yui
  • Loading branch information...
rockstar committed Dec 13, 2011
1 parent 271703c commit 5ba5dae082a9ac7911e3b998fd714e9f82662472
Showing with 62 additions and 2 deletions.
  1. +11 −2 app.js
  2. +18 −0 static/style.css
  3. +25 −0 views/index.mustache
  4. +8 −0 views/layout.mustache
View
13 app.js
@@ -2,10 +2,16 @@
var combo = require('combohandler'),
express = require('express'),
+ stache = require('stache'),
app = express.createServer();
app.configure(function() {
- app.use(express.errorHandler());
+ app.set('views', __dirname + '/views');
+ app.set('view engine', 'mustache');
+ app.use(express.bodyParser());
+ app.use(express.methodOverride());
+ app.register('.mustache', stache);
+ app.use(express.static(__dirname + '/static'));
});
app.error(function (err, req, res, next) {
@@ -16,7 +22,10 @@ app.error(function (err, req, res, next) {
}
});
-app.get('/', combo.combine({rootPath: 'build/www'}), function (req, res) {
+app.get('/', function(req, res) {
+ res.render('index', {});
+});
+app.get('/yui', combo.combine({rootPath: 'build/www'}), function (req, res) {
res.send(res.body, 200);
});
View
@@ -0,0 +1,18 @@
+body {
+ font-family: Ubuntu, Helvetica, Arial;
+ font-size: 1.2em;
+ line-height: 2.0em;
+ margin: 10px auto;
+ width: 720px;
+}
+div {
+ margin: .5em 0;
+}
+pre {
+ width: 70%;
+ border: 1px solid #333;
+ line-height: 1.5hm;
+ background-color: #ccc;
+ padding: 1em;
+ margin: 0 auto;
+}
View
@@ -0,0 +1,25 @@
+<h1>YUI 3 Nightly</h1>
+
+<div>Whether you're using the Yahoo!'s CDN, your own combo loader, or loading
+files separately<strong>*cough*</strong>masochist<strong>*cough*</strong>, it
+can be pretty complicated to test your existing code against upcoming YUI
+releases.</div>
+
+<div>Enter the YUI 3 Nightly combo loader. Each night, a new version of YUI 3's
+source tree is built and served from /yui. All you need to do is to point your
+YUI object to the nightly combo loader.</div>
+
+<div>Add the following code to your main template before any calls to
+<code>YUI().use()</code>.</div>
+
+<pre><code>YUI_config = {
+ comboBase: 'http://lolcathost:8082/yui?',
+ root: ''
+};</code></pre>
+
+<div><strong>Note:</strong> Do this in a development instance. If you point
+production to this development code, you deserve everything you get.</div>
+
+<div>There's nothing earth-shattering about this. If you're curious about the
+code, you can <a href="https://github.com/rockstar/yui3-nightly-tools">fork
+it on github</a>. Contributions welcome.</div>
View
@@ -0,0 +1,8 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>YUI 3 Nightlies</title>
+ <link rel="stylesheet" type="text/css" href="/style.css" />
+ </head>
+ <body>{{{body}}}</body>
+</html>

0 comments on commit 5ba5dae

Please sign in to comment.