From cabb09ee4e4bcb096b000a4a8bf7dba056b4b2de Mon Sep 17 00:00:00 2001 From: Matthijs van Henten Date: Mon, 19 Oct 2015 14:34:19 +0000 Subject: [PATCH 1/2] WIP use formatting foo --- package.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/package.json b/package.json index dcb1705e..c96b4d4a 100644 --- a/package.json +++ b/package.json @@ -108,6 +108,8 @@ "c9.ide.save": "#e00549cb0f", "c9.ide.scm": "#38d2b48b31", "c9.ide.terminal.monitor": "#b76f1c9f24", + "c9.ide.test": "#d312a01ac6", + "c9.ide.test.mocha": "#79ff886c04", "c9.ide.theme.flat": "#2de8414db7", "c9.ide.threewaymerge": "#229382aa0b", "c9.ide.undo": "#b028bcb4d5", From 5fa6a0ca78e44cbb8e753e80400d96eae43509b7 Mon Sep 17 00:00:00 2001 From: Lennart Kats Date: Tue, 20 Oct 2015 10:24:15 +0200 Subject: [PATCH 2/2] Add documentation or some attempt at documentation --- node_modules/c9/urls.js | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/node_modules/c9/urls.js b/node_modules/c9/urls.js index 8f5fc472..5166f944 100644 --- a/node_modules/c9/urls.js +++ b/node_modules/c9/urls.js @@ -33,9 +33,27 @@ plugin.getHost = function(req) { /** * Get a desired base URL, given some context. * - * @param req The current request object or URL - * @param {String} [sourceUrlPattern] The source URL pattern, e.g. https://ide.$DOMAIN - * @param {String} targetBaseUrlPattern The target URL pattern, e.g. https://$DOMAIN + * Example for a request coming into the IDE service: + * + * ``` + * getBaseUrl(req, "https://ide.$DOMAIN", "https://preview.$DOMAIN"); + * ``` + * + * The above example will determine the domain name from the request, + * by stripping off the "https://ide." part. So, for a domain like + * "https://ide.c9.io" we'll get "c9.io". For a domain like + * "https://ide.dogfooding-lennartcl.c9.io" we'll get dogfooding-lennartcl.c9.io. + * If there is no match, a warning is shown. The target pattern + * is used to construct the resulting URL, e.g. https://preview.c9.io. + * + * @param req + * The current request object or URL + * @param {String} [sourceUrlPattern] + * The URL pattern of the current service, e.g. https://ide.$DOMAIN if + * we are getting an incoming request for the IDE service + * @param {String} targetBaseUrlPattern + * The URL pattern of the target service. E.g., if we want to + * construct the base URL of the API service, this might be https://api.$DOMAIN. */ plugin.getBaseUrl = function(req, sourceBaseUrlPattern, targetBaseUrlPattern) { var sourceHost = plugin.getHost(req);