UNPKG

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