Adjusting Twitter authentication to work on the server

The Twitter application we set up for Notes previously won't work because the authentication URL is incorrect for the server. For now, we can log in using the user profile created previously. If you want to see OAuth work with Twitter, go to apps.twitter.com and reconfigure the application to use the IP address of your server.

By hosting somewhere other than our laptop, the Twitter callbackURL must point to the correct location. The default value was http://localhost:3000 for use on our laptop. But we now need to use the IP address for the server. In notes/package.json, add the following environment variable to the on-server script:

TWITTER_CALLBACK_HOST=http://159.89.145.190:3000 

Get Node.js Web Development - Fourth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.