UNPKG

1.38 kBJavaScriptView Raw
1/*
2 * @package jsDAV
3 * @subpackage DAV
4 * @copyright Copyright(c) 2011 Ajax.org B.V. <info AT ajax DOT org>
5 * @author Mike de Boer <info AT mikedeboer DOT nl>
6 * @license http://github.com/mikedeboer/jsDAV/blob/master/LICENSE MIT License
7 */
8"use strict";
9
10exports.debugMode = false;
11
12exports.createServer = function(options, port, host) {
13 var DAV = require("./DAV/server");
14 DAV.debugMode = exports.debugMode;
15 return DAV.createServer(options, port, host);
16};
17
18/**
19 * Create a jsDAV Server object that will not fire up listening to HTTP requests,
20 * but instead will respond to requests that are passed to
21 * 1) the custom NodeJS httpServer provided by the 'server' option or
22 * 2) the Server.handle() function.
23 *
24 * @param {Object} options Options to be passed to the jsDAV Server object, which
25 * should look like:
26 * [code]
27 * {
28 * node : path,
29 * mount : mountpoint,
30 * server : server,
31 * standalone: standalone
32 * }
33 * [/code]
34 */
35exports.mount = function(options) {
36 var DAV = require("./DAV/server");
37 DAV.debugMode = exports.debugMode;
38 return DAV.mount(options);
39};
40
41//@todo implement CalDAV
42exports.createCalDAVServer = function(options, port, host) {
43 var CalDAV = require("./CalDAV/server");
44 CalDAV.debugMode = exports.debugMode;
45 return CalDAV.createServer(options, port, host);
46};