Sha256: 3846747ba40f76d07eb15b38ec415fe90f2fc58f7521a75702defaa35a078c56

Contents?: true

Size: 568 Bytes

Versions: 74

Compression:

Stored size: 568 Bytes

Contents

var http = require('http');
var ecstatic = require('ecstatic')(__dirname);
var server = http.createServer(function (req, res) {
    if (req.url === '/doom') {
        res.setHeader('content-type', 'multipart/octet-stream');
        
        res.write('d');
        var i = 0;
        var iv = setInterval(function () {
            res.write('o');
            if (i++ >= 10) {
                clearInterval(iv);
                res.end('m');
            }
        }, 500);
    }
    else ecstatic(req, res);
});

console.log('Listening on :8082');
server.listen(8082);

Version data entries

74 entries across 72 versions & 5 rubygems

Version Path
smock-0.1.250 node_modules/webpack/node_modules/node-libs-browser/node_modules/http-browserify/example/streaming/server.js
smock-0.1.249 node_modules/webpack/node_modules/node-libs-browser/node_modules/http-browserify/example/streaming/server.js
smock-0.1.247 node_modules/webpack/node_modules/node-libs-browser/node_modules/http-browserify/example/streaming/server.js
smock-0.1.246 node_modules/webpack/node_modules/node-libs-browser/node_modules/http-browserify/example/streaming/server.js
smock-0.1.245 node_modules/webpack/node_modules/node-libs-browser/node_modules/http-browserify/example/streaming/server.js
smock-0.1.244 node_modules/webpack/node_modules/node-libs-browser/node_modules/http-browserify/example/streaming/server.js
smock-0.1.243 node_modules/webpack/node_modules/node-libs-browser/node_modules/http-browserify/example/streaming/server.js
smock-0.1.242 node_modules/webpack/node_modules/node-libs-browser/node_modules/http-browserify/example/streaming/server.js
smock-0.1.241 node_modules/webpack/node_modules/node-libs-browser/node_modules/http-browserify/example/streaming/server.js
smock-0.1.240 node_modules/webpack/node_modules/node-libs-browser/node_modules/http-browserify/example/streaming/server.js
smock-0.1.239 node_modules/webpack/node_modules/node-libs-browser/node_modules/http-browserify/example/streaming/server.js
smock-0.1.2 node_modules/webpack/node_modules/node-libs-browser/node_modules/http-browserify/example/streaming/server.js
smock-0.1.1 node_modules/webpack/node_modules/node-libs-browser/node_modules/http-browserify/example/streaming/server.js
smock-0.1.238 node_modules/webpack/node_modules/node-libs-browser/node_modules/http-browserify/example/streaming/server.js
smock-0.1.237 node_modules/webpack/node_modules/node-libs-browser/node_modules/http-browserify/example/streaming/server.js
smock-0.1.236 node_modules/webpack/node_modules/node-libs-browser/node_modules/http-browserify/example/streaming/server.js
smock-0.1.235 node_modules/webpack/node_modules/node-libs-browser/node_modules/http-browserify/example/streaming/server.js
smock-0.1.234 node_modules/webpack/node_modules/node-libs-browser/node_modules/http-browserify/example/streaming/server.js
smock-0.1.233 node_modules/webpack/node_modules/node-libs-browser/node_modules/http-browserify/example/streaming/server.js
smock-0.1.232 node_modules/webpack/node_modules/node-libs-browser/node_modules/http-browserify/example/streaming/server.js