diff options
author | Cheng-Han, Wu | 2016-05-15 09:56:01 +0800 |
---|---|---|
committer | Cheng-Han, Wu | 2016-05-15 09:56:01 +0800 |
commit | 217e683422418cc8e4d9618028864edf3e0c346d (patch) | |
tree | 9db9e784a1b0aa996236a21ebad277f60f38d3ca /lib | |
parent | 4aa4e3eacc36ae54c49ac94cf40594f33c4d9b1d (diff) | |
parent | 55a1ba0699c77ecfea2d2f2cefa6fae9ff0c289d (diff) |
Merge PR #101
Diffstat (limited to 'lib')
-rw-r--r-- | lib/config.js | 8 | ||||
-rw-r--r-- | lib/response.js | 13 |
2 files changed, 13 insertions, 8 deletions
diff --git a/lib/config.js b/lib/config.js index 6738d4a8..64d2056a 100644 --- a/lib/config.js +++ b/lib/config.js @@ -25,7 +25,7 @@ var db = config.db || { }; // ssl path -var sslkeypath = config.sslkeypath || '' +var sslkeypath = config.sslkeypath || ''; var sslcertpath = config.sslcertpath || ''; var sslcapath = config.sslcapath || ''; var dhparampath = config.dhparampath || ''; @@ -61,6 +61,7 @@ var twitter = config.twitter || false; var github = config.github || false; var dropbox = config.dropbox || false; var imgur = config.imgur || false; +var googleDrive = config.googleDrive || false; function getserverurl() { var url = ''; @@ -111,5 +112,6 @@ module.exports = { twitter: twitter, github: github, dropbox: dropbox, - imgur: imgur -};
\ No newline at end of file + imgur: imgur, + googleDrive: googleDrive, +}; diff --git a/lib/response.js b/lib/response.js index 7a75e234..9d75561a 100644 --- a/lib/response.js +++ b/lib/response.js @@ -48,7 +48,7 @@ var response = { showNote: showNote, showPublishNote: showPublishNote, showPublishSlide: showPublishSlide, - showIndex: showIndex, + showIndex: showIndex, noteActions: noteActions, publishNoteActions: publishNoteActions, githubActions: githubActions @@ -72,7 +72,8 @@ function responseError(res, code, detail, msg) { code: code, detail: detail, msg: msg, - useCDN: config.usecdn + useCDN: config.usecdn, + googleDrive: config.googleDrive, }); res.write(content); res.end(); @@ -95,6 +96,7 @@ function showIndex(req, res, next) { twitter: config.twitter, github: config.github, dropbox: config.dropbox, + googleDrive: config.googleDrive, }); res.write(content); res.end(); @@ -125,6 +127,7 @@ function responseHackMD(res, note) { twitter: config.twitter, github: config.github, dropbox: config.dropbox, + googleDrive: config.googleDrive, }); var buf = html; res.writeHead(200, { @@ -355,7 +358,7 @@ function publishNoteActions(req, res, next) { res.redirect(config.serverurl + '/' + (note.alias ? note.alias : LZString.compressToBase64(note.id))); break; default: - res.redirect(config.serverurl + '/s/' + note.shortid); + res.redirect(config.serverurl + '/s/' + note.shortid); break; } }); @@ -370,7 +373,7 @@ function githubActions(req, res, next) { githubActionGist(req, res, note); break; default: - res.redirect(config.serverurl + '/' + noteId); + res.redirect(config.serverurl + '/' + noteId); break; } }); @@ -470,4 +473,4 @@ var render = function (res, title, markdown) { })); }; -module.exports = response;
\ No newline at end of file +module.exports = response; |