Skip to content
This repository has been archived by the owner on Jul 11, 2018. It is now read-only.

server push middleware for koa w/ manifest support

Notifications You must be signed in to change notification settings

kasperlewau/koa-h2-man-pusher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

koa-h2-man-pusher

server push middleware for koa w/ manifest support

Note: This is an unstable WIP. Don't go prod.

also holds true for the readme. it is very sparse right now.

Installation

npm install koa-h2-man-pusher --save

API

manpusher([opts])

opts.root

Type: string
Default: .

Root path to read from.

opts.manifest

Type: string
Default: push_manifest.json

Path to your http2-push-manifest.

Usage

const spdy = require('spdy');
const Koa = require('koa');
const manpusher = require('koa-h2-man-pusher');

const app = new Koa();

app.use(manpusher({
  manifest: 'stuff/manifest.json',
  root: 'dist'
}));

const server = spdy.createServer({
  key: 'path/to/ssl.key',
  cert: 'path/to/ssl.crt'
}, app.callback());

server.listen(3000);

Copyright

MIT

About

server push middleware for koa w/ manifest support

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published