Neglected Parking Meter

    simple_video_response
    TypeScript icon, indicating that this package has built-in type declarations

    0.0.3 • Public • Published

    simple_video_response

    node video response

    express

    var express = require('express');
    var app = express();
    app.use(require('simple_video_response').express());
    app.get('/', (req, res, next) => {
        res.video(__dirname + '/example.mp4');
    });
    
    app.listen(3000);

    koa

    var Koa = require('koa');
    var app = new Koa();
    app.use(require('simple_video_response').koa());
    app.use(ctx => {
        return ctx.video(__dirname + '/example.mp4');
    });
    
    app.listen(3000);

    fastify

    var fastify = require('fastify')();
    fastify.register(require('simple_video_response').fastify());
    fastify.get('/', (request, reply) => {
        reply.video(__dirname + '/example.mp4');
    });
    fastify.listen(3000);

    option

    require('simple_video_response').express({
        basePath: "", // path to read file dir ( path.join(bathPath, "example.mp4") )
        fileStatCache: true, // caches file info (fs.stats)
        maxChunkSize: 1234567, // maximum sent chunk at one request
    })

    Install

    npm i simple_video_response

    DownloadsWeekly Downloads

    0

    Version

    0.0.3

    License

    BSD-2-Clause

    Unpacked Size

    10.6 kB

    Total Files

    10

    Last publish

    Collaborators

    • rudtyz