requirements: node ^6.3.0, npm ^3.10.0
This is an example of a Twitter API call using Node.js + React/Redux with Universal/Isomorphic rendering, ES6 + await/async via babel-register and webpack, testing with Mocha/Chai/Enzyme.
Get your Twitter API credentials (Tokens from dev.twitter.com)
Create a .env
file in the project root with the Twitter API credentials:
TWITTER_CONSUMER_KEY=xxxxxxxxxxxxxxxxxxxxxxxxx
TWITTER_CONSUMER_SECRET=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
TWITTER_ACCESS_TOKEN_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
TWITTER_ACCESS_TOKEN_SECRET=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
the .env
file will be automatically loaded when you npm start
, npm test
, or npm run build
NODE_ENV=production npm install
npm start
http://localhost:8080
NODE_ENV=development npm install
npm run lint
npm test
Make sure dev dependencies are installed
npm run build