4949// * `Jira API Version<string>`: Known to work with `2` and `2.0.alpha1`
5050// * `verbose<bool>`: Log some info to the console, usually for debugging
5151// * `strictSSL<bool>`: Set to false if you have self-signed certs or something non-trustworthy
52- // * `oauth`: A dictionary of `consumer_key`, `consumer_secret`, `access_token` and `access_token_secret` to be used for OAuth authentication.
52+ // * `oauth`: A dictionary of `consumer_key`, `consumer_secret`, `access_token` and `access_token_secret` to be used for OAuth authentication.
53+ // * `base`: Add base slug if your JIRA install is not at the root of the host
5354//
5455// ## Implemented APIs ##
5556//
@@ -132,13 +133,14 @@ var url = require('url'),
132133 OAuth = require ( "oauth" ) ;
133134
134135
135- var JiraApi = exports . JiraApi = function ( protocol , host , port , username , password , apiVersion , verbose , strictSSL , oauth ) {
136+ var JiraApi = exports . JiraApi = function ( protocol , host , port , username , password , apiVersion , verbose , strictSSL , oauth , base ) {
136137 this . protocol = protocol ;
137138 this . host = host ;
138139 this . port = port ;
139140 this . username = username ;
140141 this . password = password ;
141142 this . apiVersion = apiVersion ;
143+ this . base = base ;
142144 // Default strictSSL to true (previous behavior) but now allow it to be
143145 // modified
144146 if ( strictSSL == null ) {
@@ -156,6 +158,9 @@ var JiraApi = exports.JiraApi = function(protocol, host, port, username, passwor
156158 if ( altBase != null ) {
157159 basePath = altBase ;
158160 }
161+ if ( this . base ) {
162+ basePath = this . base + '/' + basePath ;
163+ }
159164
160165 var apiVersion = this . apiVersion ;
161166 if ( altApiVersion != null ) {
0 commit comments