UNPKG

3.93 kBMarkdownView Raw
1Brackets Server
2===============
3
4Brackets Server is a server for providing hosted version of the popular code editor [Brackets](http://brackets.io/). The code editor can be loaded directly in the web browser and it doesn’t require additional installations or browser extensions. Brackets works just like the desktop version, except that all projects and files reside on the server instead of the local file system.
5
6The server may be useful for remote development, real-time changes and testing, development form thin clients or devices such as tablets, or it could be used in conjunction with other web applications for collaboration.
7
8To check the current verion of Brackets source used in the server, please see [CHANGELOG](CHANGELOG.md).
9
10Installation
11------------
12
13Install from npm:
14
15 $ npm install brackets -g
16
17Usage Examples
18--------------
19
20 $ brackets --port 80 --proj-dir /var/projects --supp-dir /var/brackets
21
22**IMPORTANT:** Make sure ***projects*** directory exists.
23
24All arguments are optional.
25
26| Short Option | Long Option | Default Value | Description
27|--------------|--------------|-------------------|------------------------------------------------------------
28| `-p <prot>` | `--port` | `6800` | TCP port on which Brackets server is listening.
29| `-j <dir>` | `--proj-dir` | `~/Projects` | Root directory for projects. Directories above this root cannot be accessed.
30| `-s <dir>` | `--supp-dir` | `~/.brackets-srv` | Root directory for Brackets supporting files such as user extensions, configurations and state persistence.
31
32Embedding Brackets Server in Web Applications
33---------------------------------------------
34
35Example with Express:
36
37```javascript
38 var path = require("path"),
39 http = require("http"),
40 express = require("express"),
41 brackets = require("brackets"),
42 app = express(),
43 server = http.createServer(app);
44
45 app.get("/", function (req, res) {
46 res.send("Hello World");
47 });
48
49 var bracketsOpts = {
50 projectsDir: path.join(__dirname, ".."),
51 supportDir: path.join(__dirname, "..", "/support")
52 };
53 brackets(server, bracketsOpts);
54
55 server.listen(3000);
56
57 console.log("Your application is availble at http://localhost:3000");
58 console.log("You can access Brackets on http://localhost:3000/brackets/");
59```
60
61**NOTE:** The default values for `projectsDir` and `supportDir` are different when Brackets Server is initiated from code. They are respectively `./projects` and `./brackets`, relative to the current working directory. Same as the CLI, the ***projects*** directory must exist, otherwise Open and Create project will not work.
62
63Contributing
64------------
65
66Please see [`CONTRIBUTING.md`](CONTRIBUTING.md)
67
68License
69-------
70
71(MIT License)
72
73Copyright (c) 2012 Boyan Rabchev <boyan@rabchev.com>. All rights reserved.
74
75Permission is hereby granted, free of charge, to any person obtaining
76a copy of this software and associated documentation files (the
77'Software'), to deal in the Software without restriction, including
78without limitation the rights to use, copy, modify, merge, publish,
79distribute, sublicense, and/or sell copies of the Software, and to
80permit persons to whom the Software is furnished to do so, subject to
81the following conditions:
82
83The above copyright notice and this permission notice shall be
84included in all copies or substantial portions of the Software.
85
86THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
87EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
88MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
89IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
90CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
91TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
92SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.