Server Info - GlobalMustard/SocialSync GitHub Wiki

To Get Server Running:

To Install:

npm install (installs all npm modules in root directory)

To Start Server:

  • navigate to backend folder
  • $ node server

###To Access Server: 127.0.0.1:3000 (or localhost:3000)

API Endpoints:

/twitter/

  • this is the endpoint that will return the logged in users home timeline in JSON format
  • visit this first and you will see a 401 unauthorized error
  • once you visit /auth/twitter, then revisit /twit and you will see the users timeline
  • NOTE: As of right now the token and secret are being stored in the server.js file. This is not working as intended. We will need to be able to pass in the token and secret that are currently stored in localstorage into the /twitter endpoint in order for this to work properly (detailed below)
  • this is a post request because we need to pass in the user's token and secret as a parameter

/auth/twitter

  • this will log the user in
  • use username: jeff_vandalsum, password: jeffvan1
  • once logged in you will be redirected to /auth/twitter/callback and the user's token and secret will be on the screen => these are what will need to be stored into a database or localstorage
  • these two items will also need to be passed BACK into the post request to /twitter which will allow twitter to ensure the user has proper access through the oauth request.

*** NOTE: We can open up any number of endpoints on the twitter api besides the user_timeline (Twitter API points dev.twitter.com), but for now that holds all messages and is a good test to get data up on the MVP.

Twitter Authorization Process Reference: Twitter Auth

/auth/facebook

  • this will log the user into facebook
  • use username: [email protected], passport: socialsync
  • once logged in, you'll be directed to /auth/facebook/callback and the user's access token will be temporarily stored on the server (This needs to be fixed). This access token will need to be accessible during the facebook API request to get the user's wall