UNPKG

2.53 kBMarkdownView Raw
1Connect middleware exposing the Dojo Toolkit
2============================================
3
4This Connect middleware transparently download and display Dojo files.
5
6In 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
22Options
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
29Using a released version of Dojo
30--------------------------------
31
32Source code is downloaded from the official Dojo website and all the versions
33present on the website are available. For example to download the version '1.5.0', setup
34the middleware as:
35
36 dojo({ version: '1.7.1' })
37
38Using the git HEAD
39------------------
40
41If the option 'method' is set to 'git' and the revision option of a dojo project
42is not defined, the middleware will checkout the HEAD revision. Each Dojo project
43will be store inside a directory defined by the option 'repository' and named as "git-#{project}-HEAD"
44
45Using a specific git revision
46-----------------------------
47
48If 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
50the revision in a specific directory inside the one defined by the option 'repository'
51and named as "git-${project}-#{revision}".
52
53General note
54------------
55
56To prevent multiple application from conflicting, a new directory is created
57for each released version and git revision. This can lead to a large number of directories
58as new revisions are setup over time. By default, source code is stored inside the
59connect-dojo module and it is recommended to define your own directory through
60the 'repository' option.
61
62Testing
63-------
64
65Running the tests can take a long time because of the size of dojo. Using
66expresso, run the following command by adjusting the '-t' (timeout) argument:
67
68 expresso -s -t 10000 test