Skip to content

slvcsl/twitter_nodejs

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

twitter_nodejs

Build Setup

# install dependencies
npm install

# run at localhost:3000
npm start

# Example
GET http://localhost:3000/tweets/
GET http://localhost:3000/tweets/from/cfarre
POST http://localhost:3000/tweets/
with body
{
    "message": "Super tweet"
}

Add routes

# Add new routes
.js files in /routes/

# Include new routes
add a line following the previous examples in app.js under the two 'ADD HERE' comment

Additional info

# Nodemon : automatically restart the application after changes
npm install -g nodemon
then use 'nodemon' instead of 'npm start'

# Connection with Twitter API
https://apps.twitter.com/
Create new app > Keys and Access Tokens > Create my access token

# Environment variables
Create a file named '.env' at the root of the project with the variables :
CONSUMER_KEY=value
CONSUMER_SECRET=value
ACCESS_TOKEN=value
ACCESS_TOKEN_SECRET=value

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 97.9%
  • HTML 1.5%
  • CSS 0.6%