Skip to content
This repository was archived by the owner on Jan 18, 2021. It is now read-only.

Commit 1c6c15b

Browse files
GitBrentGitBrent
GitBrent
authored and
GitBrent
committed
Updated for v1.4.0
1 parent 2f1f4ec commit 1c6c15b

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

dist/sprestlib.bundle.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/sprestlib.bundle.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/sprestlib.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,7 @@ var NODEJS = ( typeof module !== 'undefined' && module.exports );
605605
if ( typeof inStr !== 'string' || inStr == '' || !inStr ) return APP_OPTS.baseUrl;
606606

607607
// CASE 2: Act as a SETTER
608-
APP_OPTS.baseUrl = inStr;
608+
APP_OPTS.baseUrl = inStr.replace(/\/+$/,'');
609609
if (DEBUG) console.log('APP_OPTS.baseUrl = '+APP_OPTS.baseUrl);
610610
}
611611

@@ -1525,7 +1525,7 @@ var NODEJS = ( typeof module !== 'undefined' && module.exports );
15251525
Promise.resolve()
15261526
.then(function(){
15271527
return new Promise(function(resolve, reject) {
1528-
if ( NODEJS && !APP_OPTS.nodeEnabled ) {
1528+
if ( NODEJS && APP_OPTS.nodeEnabled ) {
15291529
objAjaxQuery.headers["Cookie"] = APP_OPTS.nodeCookie;
15301530
delete objAjaxQuery.headers["X-RequestDigest"];
15311531
var options = {

example/nodejs-demo.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
/*
22
* NAME: nodejs-demo.js
33
* AUTH: Brent Ely (https://github.com/gitbrent/)
4-
* DATE: Sep 07, 2017
54
* DESC: Demonstrate SpRestLib on Node.js
65
* REQS: Node 4.x + `npm install sprestlib`
76
* EXEC: `node nodejs-demo.js (sp-username) (sp-password) {sp-hostUrl}`
7+
* VER.: 1.4.0
8+
* REL.: 20180108
89
* REFS: HOWTO: Authenticate to SharePoint Online (*.sharepoint.com)
910
* - https://allthatjs.com/2012/03/28/remote-authentication-in-sharepoint-online/
1011
* - http://paulryan.com.au/2014/spo-remote-authentication-rest/
@@ -34,7 +35,7 @@ else {
3435
// Lets go
3536
console.log('\nStarting demo...');
3637
console.log('================================================================================');
37-
console.log(`> SpRestLib version: ${sprLib.version()}\n`); // Loaded okay?
38+
console.log(`> SpRestLib version: ${sprLib.version}\n`); // Loaded okay?
3839

3940
// Office365/On-Prem/Hosted Vars
4041
var SP_USER = process.argv[2];
@@ -153,6 +154,7 @@ Promise.resolve()
153154

154155
// B: SpRestLib also needs the full path to your site
155156
sprLib.baseUrl('/sites/dev/');
157+
//console.log( 'sprLib.baseUrl = '+ sprLib.baseUrl() );
156158

157159
// C: Now run all the sprLib API calls you want
158160
return sprLib.user().info();

0 commit comments

Comments
 (0)