1 | Node-Brackets
|
2 | -------------
|
3 |
|
4 | Node-Brackets is a [Node.js](http://nodejs.org) module implemented as [Connect](http://www.senchalabs.org/connect/) middleware which
|
5 | integrates [Adobe Brackets](http://brackets.io/) code editor in Node.js based web applications.
|
6 | It provides exceptionally convenient way to manage, edit and test project files
|
7 | directly on the server via web browser. Brackets doesn't have to be installed on
|
8 | client machines, it opens in a web browser and comunicates with the server over
|
9 | standard HTTP protocol.
|
10 |
|
11 | This module might be useful for remote development, real-time changes and testing,
|
12 | development form a thin client or device such as tablet, or it could be used in
|
13 | conjunction with other modules for collaboration.
|
14 |
|
15 | Installation
|
16 | ------------
|
17 |
|
18 | Install from npm:
|
19 |
|
20 | $ npm install brackets
|
21 |
|
22 | Usage Examples
|
23 | --------------
|
24 |
|
25 | Create test app:
|
26 |
|
27 | $ mkdir my-app
|
28 | $ cd my-app
|
29 | $ npm install connect
|
30 | . . .
|
31 | $ npm install brackets
|
32 | . . .
|
33 |
|
34 | Add 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 |
|
50 | Start the app:
|
51 |
|
52 | $ node index
|
53 |
|
54 | Open Google Chrome bowser and type **http://localhost:3000** in the address bar.
|
55 | At this point you should see “Hello World”. Navigate to **http://localhost:3000/brackets**.
|
56 | Now you should see Brackets UI and the contents of your working directory, including Brackets source.
|
57 |
|
58 | To 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 |
|
67 | NOTE: the specified directories must exist, otherwise an exception will be thrown.
|
68 |
|
69 | There is an example project based on [Express](http://expressjs.com/) MVC example,
|
70 | located 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 |
|
72 | If you want to be able to see your code changes immediately on the live site, without manually restarting Node,
|
73 | you could use [node-supervisor](https://github.com/isaacs/node-supervisor) or similar module.
|
74 |
|
75 | Security Considerations
|
76 | -----------------------
|
77 |
|
78 | Browser Compatibility
|
79 | ---------------------
|
80 |
|
81 | Known Issues
|
82 | ------------
|
83 |
|
84 | Roadmap
|
85 | ------- |
\ | No newline at end of file |