twitter-oauth-echo

Express Middleware for Twitter Oauth Echo

Usage no npm install needed!

<script type="module">
  import twitterOauthEcho from 'https://cdn.skypack.dev/twitter-oauth-echo';
</script>

README

Installation

  npm install twitter-oauth-echo --save 

Basic Usage

Request must contain x-auth-service-provider and x-verify-credentials-authorization headers.View resources for more info.

var express = require('express');
var app = express();
var twitterEcho = require('twitter-oauth-echo');

app.use(twitterEcho({ errorMessage : 'You are not authorized' })); 
//errorMessage defaults to UnAuthorized 

Sample usage with express.Router object.

var express = require('express');
var twitterEcho = require('twitter-oauth-echo');
var router = express.Router();

//check for all routes and methods of router 
router.all('*' , twitterEcho());

router.get('/hello' , function(req , res ){
    res.send('hello will be sent if req is authorized.');
});

module.exports = router ;

Resources

License

This repository is licensed under the MIT License