UNPKG

2.89 kBMarkdownView Raw
1Node-Brackets
2-------------
3
4Node-Brackets is a [Node.js](http://nodejs.org) module implemented as [Connect](http://www.senchalabs.org/connect/) middleware which
5integrates [Adobe Brackets](http://brackets.io/) code editor in Node.js based web applications.
6It provides exceptionally convenient way to manage, edit and test project files
7directly on the server via web browser. Brackets doesn't have to be installed on
8client machines, it opens in a web browser and comunicates with the server over
9standard HTTP protocol.
10
11This module might be useful for remote development, real-time changes and testing,
12development form a thin client or device such as tablet, or it could be used in
13conjunction with other modules for collaboration.
14
15Installation
16------------
17
18Install from npm:
19
20 $ npm install brackets
21
22Usage Examples
23--------------
24
25Create test app:
26
27 $ mkdir my-app
28 $ cd my-app
29 $ npm install connect
30 . . .
31 $ npm install brackets
32 . . .
33
34Add index.js file to my-app directory and enter the folwoing code:
35
36```js
37 var connect = require('connect'),
38 brackets = require('brackets');
39
40 connect()
41 .use('/brackets', brackets())
42 .use(function (req, res) {
43 res.end('Hello World');
44 })
45 .listen(3000);
46
47 console.log("\n listening on port 3000\n");
48```
49
50Start the app:
51
52 $ node index
53
54Open Google Chrome bowser and type **http://localhost:3000** in the address bar.
55At this point you should see “Hello World”. Navigate to **http://localhost:3000/brackets**.
56Now you should see Brackets UI and the contents of your working directory, including Brackets source.
57
58To limit the access to specific directory/s you can pass an argument to brackets function.
59
60* brackets("resources");
61 the directory "./resources/" will become the project root.
62
63* brackets(\["controllers", "views", "public"\]);
64 the directory "./controllers/" will become the initial project root and the other folders will be accessible via
65 Recent Projects dropdown (the small arrow above the navigation tree).
66
67NOTE: the specified directories must exist, otherwise an exception will be thrown.
68
69There is an example project based on [Express](http://expressjs.com/) MVC example,
70located in [https://github.com/rabchev/node-brackets-module/tree/master/examples/express-mvc](https://github.com/rabchev/node-brackets-module/tree/master/examples/express-mvc).
71
72If you want to be able to see your code changes immediately on the live site, without manually restarting Node,
73you could use [node-supervisor](https://github.com/isaacs/node-supervisor) or similar module.
74
75Security Considerations
76-----------------------
77
78Browser Compatibility
79---------------------
80
81Known Issues
82------------
83
84Roadmap
85-------
\No newline at end of file