0.0.1 • Published 8 years ago

kiss-injection-dev-server v0.0.1

Weekly downloads
2
License
ISC
Repository
github
Last release
8 years ago

Kiss Injection Dev Server

This dev server provides development environment in which script can be injected directly as the last child of head element. The server contains two parts, proxy server and static server. Proxy server intercepts requests and injects a script. Static server serves the script injected by the proxy server.

Installing

$ npm install --save-dev kiss-injection-dev-server

API and Examples

// just import this package
const devServer = require('kiss-injection-dev-server');

// launch the dev server
devServer({
    // (optional) proxy server's port: default to 8080
    proxyServerPort: '8080',

    // (optional) static server ip: default to '127.0.0.1'
    staticServerIp: '127.0.0.1',

    // (optional) static server port: default to 8081
    staticServerPort: '8081',

    // (optional) the name of injection script: default to Injection.js
    injectionScriptFileName: 'Injection.js',

    // (required) the folder where injection script lives in
    injectionScriptDir: 'folder/of/your/injectionScript'
})

Whether dev server works

You can inspect the response headers in your browser and check if there is a header 'X-proxied-by': ''