Coder Social home page Coder Social logo

webmaker-connect-node-example's Introduction

Webmaker Connect Node Example App

This is a very simple OAuth consumer that uses Webmaker Connect to access information and services related to a user's Webmaker account.

Prerequisites

Node 0.10.

Quick Start

First visit the Webmaker Connect site to create an app for yourself. You'll need your app's API key and secret below.

git clone git://github.com/toolness/webmaker-connect-node-example.git
cd webmaker-connect-node-example
npm install
export API_KEY='YOUR API KEY GOES HERE'
export API_SECRET='YOUR API SECRET GOES HERE'
node app.js

Then visit http://127.0.0.1:8000 and try logging in.

Environment Variables

  • PORT is the port that the server binds to. Defaults to 8000.

  • COOKIE_SECRET is the secret used to encrypt and sign cookies, to prevent tampering. By default, it will be set to a random value; the downside of this default is that every time you restart the server, any existing cookies will be invalid, since COOKIE_SECRET will have changed. And if you actually want to deploy this app and have it scale across multiple processes, you'll definitely want to define this, so that every process uses the same key.

  • ORIGIN is the origin of the server, as it appears to users. It defaults to http://127.0.0.1:PORT.

  • WMCONNECT_ORIGIN is the origin of the Webmaker Connect server, which defaults to https://webmaker-connect.herokuapp.com.

  • API_KEY is the OAuth consumer key for your app. You can get it by creating a new app on the Webmaker Connect site.

  • API_SECRET is the OAuth consumer secret for your app. You can get it by creating a new app on the Webmaker Connect site.

Troubleshooting

If you're running the Webmaker Connect server locally, make sure it uses a different hostname than this server; otherwise, cookie sessions between the two servers will collide and overwrite each other. This is why this server uses 127.0.0.1 in its default origin, while the Webmaker Connect development server uses localhost.

webmaker-connect-node-example's People

Contributors

toolness avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.