Static website using the Twitter API to return a tweet feed.
We are using /search/tweets
twitter endpoint - search/tweets endpoint.
App runs on node port or :8889
.
Static assets served on port :8888
if needed.
Dev mode:
npm run dev
The app is bootstrapped with create-react-app.
/
route/tweets
route
OAUTH2 flow. Bearer token needed - Obtain a bearer token - to access Twitter API endpoints.
Proxy handling OAUTH and Twitter API request is running on node port or :8889
.
npm run proxy
and its route is /search/token
.
Register to the twitter API website.
create a token.js
file in the config
dir exposing your App token accessToken
, consumerToken
, consumerTokenSecret
and accessTokenSecret
keys from your Twitter API:
module.exports = {
accessToken: "<YOUR_OWN_ACCESS_TOKEN>",
accessTokenSecret: "<YOUR_OWN_ACCESS_TOKEN_SECRET>",
consumerToken: "<YOUR_OWN_CONSUMER_TOKEN>",
consumerTokenSecret: ""<YOUR_OWN_CONSUMER_TOKEN_SECRET>",
}
npm run build
to bundle the app.
npm run dev
for development mode.
npm run lint
to lint your code.
Deployed with now
npm run deploy
, and make sure to add your now secret keys - now secret add <YOUR_4_KEYS>
- before deploying.
Run now secret list
to show your secret variables - will be passed in your npm scripts as @yourkey
.
- tests
- pug js templates compiled on client side
- switch builds scripts from
webpack
togulp
- user sessions
In dev mode /test/controller
route is available to render a pug template serverside via DOM injection on clientside.