Skip to content

Module to cache(in redis) and/or proxy web service requests

Notifications You must be signed in to change notification settings

mvcuccaro/node-ws-cache-and-proxy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

node-ws-cache-and-proxy

A simple module to cache/log an incoming web service request to a redis db before forwarding to an endpoint. You can also provid joi schemas to validate data payloads and return custom error/output.

Table of Contents

Installation

npm install git https://github.com/mvcuccaro/node-ws-cache-and-proxy.git

Usage

Sample code

const wscp = require('node-ws-cache-and-proxy');

let proxy = wscp({
	do_not_proxy: false
});

proxy.registerService({
	name: 'test',
	baseurl: 'http://localhost/'
});

server = proxy.listen(3000, () => {
	console.log('wscp listening');
})

Command Line Options

  • --wscp_redis_host - the ip of a redis server (default: localhost)
  • --wscp_redis_port - the port of the redis server (default: 6379)
  • --wscp_redis_key_prefix - prefix key for redis hashes and names used by the cacher (default: wscp)
  • --wscp_redis_initial_cache_id - starting value for the cache record autoincrement (default: 1)

About

Module to cache(in redis) and/or proxy web service requests

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published