node-redisproxy

0.1.2 • Public • Published

Node Redis Proxy

This is a very very simple script that allows you to ship HTML files from redis. This is to work in conjunction with https://github.com/Blooie/grunt-redis

Usage

To install just do npm install -g node-redisproxy

To run just do node-redisproxy

It currently takes 3 things throught the environment:

PORT // the port for the http server to listen on
redisPort // [optional] port to connect to redis server
redisHost // [optional] redis server host

when you make a request to the redis proxy it will just take the pathname (after the first /) as the key string so this url

http://localhost:8080/my/folder/index.html

would return the html with key my/folder/index.html

Features

It's simple but it still has 2 features: prefix and branch

Prefix header

If you want to prefix a key with something from say an Nginx forward proxy then you just need to add the x-prefix header

getting this url

http://localhost:8080/my/folder/index.html

with the x-prfix header set to website will give the html with key website:my/folder/index.html

Branch get parameter

If you want to prefix a key with a get parameter just add ?branch=something to your url

getting this url

http://localhost:8080/my/folder/index.html?branch=develop

will give the html with key develop:my/folder/index.html

Bringing it all together

Prefix and branch stack in the format prefix:branch:pathname

so if you get this url

http://localhost:8080/my/folder/index.html?branch=develop

with the x-prfix header set to website will give the html with key develop:website:my/folder/index.html

Readme

Keywords

Package Sidebar

Install

npm i node-redisproxy

Weekly Downloads

1

Version

0.1.2

License

MIT

Last publish

Collaborators

  • real_ate