0.2.0 • Published 12 years ago
node-decorate v0.2.0
node-decorate
A proxy server to decorate a html/xml document with jQuery.
Use case
Case 1.Inside web server
- Install to server(s) web server running.
- Route HTTP requests to this proxy.
Case 2. Independent proxy
- Install to any server(s).
- Access this proxy by formatted URL.(see below)
Install
npm install node-decorate
Comming soon !
Usage
Hello, world
- Edit /src/custom.js
module.exports = {
append_manipulate : ['hello']
}
module.exports.proc_for_elements = {
hello : function($) {
$('body').attr('onload', 'alert("Hello, world !")');
}
};
- Start a proxy.
node index.js
- Access any site through this proxy. ex. http://127.0.0.1:8124/http/nodejs.org/
URL format
Host is this proxy. http://127.0.0.1:8124/http/nodejs.org/api/
Protocol of target URL (now, http only) http://127.0.0.1:8124/http/nodejs.org/api/
Host and path of target URL http://127.0.0.1:8124/http/nodejs.org/api/
Tips
Start a proxy on production mode
npm start
Load jQuery from local file
TODO: later
Start on port 80
TODO: later
0.2.0
12 years ago