0.0.1 • Published 8 years ago

local-update-server v0.0.1

Weekly downloads
-
License
MIT
Repository
-
Last release
8 years ago

local-update-server

A tool that creates a local update server, Useful for local testing and such.

Using this tool one defines a version and a download http endpoints, the tool then takes over the domains used (hosts file) and serves the content.

npm status

CLI Tool

npm install -g local-update-server

local-update-server --update-url="http://blablabla.com/version" --update-version="1.2.3" --file="/some/path/to/file" --fileUrl="http://blablabla.com/download"

API

npm install --save local-update-server

var localUpdateServer = require('local-update-server')
var parseUrl = require('url').parse

var opts = {
    updateUrl: parseUrl('http://blabla.com:9090/version'),
    fileUrl: parseUrl('http://foobar.com/download'),
    file: '/path/to/file',
    updateVersion: '0.0.1'
}

var domains = [opts.fileUrl.hostname, opts.updateUrl.hostname]

index.dnsTakeover(domains)

process.on('exit', function () {
    index.dnsRemove(domains)
})

index.app(opts, function (err) {
    if (err) return console.error(err)
    console.log('ready')
})

license

MIT © Yaniv Kessler