49
49
// * `Jira API Version<string>`: Known to work with `2` and `2.0.alpha1`
50
50
// * `verbose<bool>`: Log some info to the console, usually for debugging
51
51
// * `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
53
54
//
54
55
// ## Implemented APIs ##
55
56
//
@@ -132,13 +133,14 @@ var url = require('url'),
132
133
OAuth = require ( "oauth" ) ;
133
134
134
135
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 ) {
136
137
this . protocol = protocol ;
137
138
this . host = host ;
138
139
this . port = port ;
139
140
this . username = username ;
140
141
this . password = password ;
141
142
this . apiVersion = apiVersion ;
143
+ this . base = base ;
142
144
// Default strictSSL to true (previous behavior) but now allow it to be
143
145
// modified
144
146
if ( strictSSL == null ) {
@@ -156,6 +158,9 @@ var JiraApi = exports.JiraApi = function(protocol, host, port, username, passwor
156
158
if ( altBase != null ) {
157
159
basePath = altBase ;
158
160
}
161
+ if ( this . base ) {
162
+ basePath = this . base + '/' + basePath ;
163
+ }
159
164
160
165
var apiVersion = this . apiVersion ;
161
166
if ( altApiVersion != null ) {
0 commit comments