1 | Connect middleware exposing the Dojo Toolkit
|
2 | ============================================
|
3 |
|
4 | This Connect middleware transparently download and display Dojo files.
|
5 |
|
6 | In its simplest form, it takes no argument and the latest stable release is used. Here is a quick example:
|
7 |
|
8 | var express = require('express');
|
9 | var dojo = require('connect-dojo');
|
10 | var app = express.createServer();
|
11 | app.configure(
|
12 | app.use(express.bodyParser());
|
13 | app.use(express.methodOverride());
|
14 | app.use(express.cookieParser());
|
15 | app.use(dojo());
|
16 | app.use(app.router);
|
17 | app.use(express.static(__dirname + '/public'));
|
18 | app.use(express.errorHandler({ dumpExceptions: true, showStack: true }));
|
19 | );
|
20 | app.listen(3000);
|
21 |
|
22 | Options
|
23 | -------
|
24 |
|
25 | - *method*, support 'release' (default) and 'git'
|
26 | - *repository*, Default parent directory where source codes are downloaded
|
27 | - *version*, Dojo version, currently `'1.7.1'`, apply only to the 'download' method
|
28 |
|
29 | Using a released version of Dojo
|
30 | --------------------------------
|
31 |
|
32 | Source code is downloaded from the official Dojo website and all the versions
|
33 | present on the website are available. For example to download the version '1.5.0', setup
|
34 | the middleware as:
|
35 |
|
36 | dojo({ version: '1.7.1' })
|
37 |
|
38 | Using the git HEAD
|
39 | ------------------
|
40 |
|
41 | If the option 'method' is set to 'git' and the revision option of a dojo project
|
42 | is not defined, the middleware will checkout the HEAD revision. Each Dojo project
|
43 | will be store inside a directory defined by the option 'repository' and named as "git-#{project}-HEAD"
|
44 |
|
45 | Using a specific git revision
|
46 | -----------------------------
|
47 |
|
48 | If the option 'method' is set to 'git' and one of 'dojo_revision', 'dijit_revision',
|
49 | 'dojox_revision' or 'util_revision' is defined, then the middleware to checkout
|
50 | the revision in a specific directory inside the one defined by the option 'repository'
|
51 | and named as "git-${project}-#{revision}".
|
52 |
|
53 | General note
|
54 | ------------
|
55 |
|
56 | To prevent multiple application from conflicting, a new directory is created
|
57 | for each released version and git revision. This can lead to a large number of directories
|
58 | as new revisions are setup over time. By default, source code is stored inside the
|
59 | connect-dojo module and it is recommended to define your own directory through
|
60 | the 'repository' option.
|
61 |
|
62 | Testing
|
63 | -------
|
64 |
|
65 | Running the tests can take a long time because of the size of dojo. Using
|
66 | expresso, run the following command by adjusting the '-t' (timeout) argument:
|
67 |
|
68 | expresso -s -t 10000 test
|