[Server] Fix bug
This commit is contained in:
		
							parent
							
								
									728bbb658e
								
							
						
					
					
						commit
						6f7cf99f19
					
				
					 1 changed files with 14 additions and 12 deletions
				
			
		|  | @ -3,12 +3,13 @@ import * as express from 'express'; | ||||||
| const Twitter = require('twitter'); | const Twitter = require('twitter'); | ||||||
| import config from '../../../conf'; | import config from '../../../conf'; | ||||||
| 
 | 
 | ||||||
| const client = new Twitter({ | module.exports = (req: express.Request, res: express.Response) => { | ||||||
|  | 	if (config.twitter) { | ||||||
|  | 		const client = new Twitter({ | ||||||
| 			consumer_key: config.twitter.consumer_key, | 			consumer_key: config.twitter.consumer_key, | ||||||
| 			consumer_secret: config.twitter.consumer_secret | 			consumer_secret: config.twitter.consumer_secret | ||||||
| }); | 		}); | ||||||
| 
 | 
 | ||||||
| module.exports = (req: express.Request, res: express.Response) => { |  | ||||||
| 		client.post('oauth/request_token', { | 		client.post('oauth/request_token', { | ||||||
| 			oauth_callback: config.url + '/tw/cb' | 			oauth_callback: config.url + '/tw/cb' | ||||||
| 		}, (x, y, z) => { | 		}, (x, y, z) => { | ||||||
|  | @ -16,4 +17,5 @@ module.exports = (req: express.Request, res: express.Response) => { | ||||||
| 			console.log(y); | 			console.log(y); | ||||||
| 			console.log(z); | 			console.log(z); | ||||||
| 		}); | 		}); | ||||||
|  | 	} | ||||||
| }; | }; | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue