2013-10-26 30 views
0

我使用https://github.com/ganarajpr/express-angular並獲得當我嘗試運行應用程序此錯誤:配置Twitter的everyauth`consumerKey`節點的角度表達引導web應用程序

git clone https://github.com/ganarajpr/express-angular.git && cd express-angular/ && npm install && nodemon app.js

$ nodemon app.js 
26 Oct 09:55:31 - [nodemon] v0.7.10 
26 Oct 09:55:31 - [nodemon] to restart at any time, enter `rs` 
26 Oct 09:55:31 - [nodemon] watching: /Users/qihanzhang/git/express-angular 
26 Oct 09:55:31 - [nodemon] starting `node app.js` 
connect.multipart() will be removed in connect 3.0 
visit https://github.com/senchalabs/connect/wiki/Connect-3.0 for alternatives 
connect.limit() will be removed in connect 3.0 

/Users/qihanzhang/git/express-angular/node_modules/everyauth/lib/modules/everymodule.js:133 
     throw new Error(debugMsg); 
      ^
Error: WARNING: You are trying to access the attribute/method configured by `consumerKey`, which you did not configure. Time to configure it. 
    at EveryModule.(anonymous function) [as consumerKey] (/Users/qihanzhang/git/express-angular/node_modules/everyauth/lib/modules/everymodule.js:133:13) 
    at EveryModule.<anonymous> (/Users/qihanzhang/git/express-angular/node_modules/everyauth/lib/modules/oauth.js:27:14) 
    at EveryModule.init (/Users/qihanzhang/git/express-angular/node_modules/everyauth/lib/modules/everymodule.js:77:8) 
    at EveryModule.routeApp (/Users/qihanzhang/git/express-angular/node_modules/everyauth/lib/modules/everymodule.js:270:23) 
    at Object.everyauth.middleware (/Users/qihanzhang/git/express-angular/node_modules/everyauth/index.js:38:15) 
    at Function.app.configure.app.use.express.errorHandler.dumpExceptions (/Users/qihanzhang/git/express-angular/app.js:103:21) 
    at Function.app.configure (/Users/qihanzhang/git/express-angular/node_modules/express/lib/application.js:391:61) 
    at Object.<anonymous> (/Users/qihanzhang/git/express-angular/app.js:92:5) 
    at Module._compile (module.js:456:26) 
    at Object.Module._extensions..js (module.js:474:10) 
26 Oct 09:55:31 - [nodemon] app crashed - waiting for file changes before starting... 

我不知道在哪裏這consumerKey應配置,我看着在everymodule.js但只發現這一點:

/** 
* Convenience method for all you coffee-script lovers, e.g., 
* 
* everyauth.dropbox.configure 
* consumerKey:  conf.dropbox.consumerKey 
* consumerSecret: conf.dropbox.consumerSecret 
* findOrCreateUser: (sess, accessToken, accessSecret, dbMeta) -> users[dbMeta.uid] or= addUser('dropbox', dbMeta) 
* redirectPath:  '/' 
*/ 
EveryModule.prototype.configure = function (conf) { 
    for (var k in conf) { 
    this[k](conf[k]); 
    } 
    return this; 
}; 

任何想法哪裏/如何配置此關鍵?我想我在node_modules/everyauth/lib/modules/oauth.js中找到了它,但是是否還需要配置所有其他字段?謝謝!

var oauth = module.exports = 
everyModule.submodule('oauth') 
    .configurable({ 
     apiHost: 'e.g., https://api.twitter.com' 
    , oauthHost: 'the host for the OAuth provider' 
    , requestTokenPath: "the path on the OAuth provider's domain where we request the request token, e.g., /oauth/request_token" 
    , accessTokenPath: "the path on the OAuth provider's domain where we request the access token, e.g., /oauth/access_token" 
    , authorizePath: 'the path on the OAuth provider where you direct a visitor to login, e.g., /oauth/authorize' 
    , sendCallbackWithAuthorize: 'whether you want oauth_callback=... as a query param send with your request to /oauth/authorize' 
    , consumerKey: 'the api key provided by the OAuth provider' 
    , consumerSecret: 'the api secret provided by the OAuth provider' 
    , myHostname: 'e.g., http://localhost:3000 . Notice no trailing slash' 

回答