Skip to content

Instantly share code, notes, and snippets.

@jinwoo
Created April 6, 2018 16:45
Show Gist options
  • Save jinwoo/bcb6e4ebe205cf823482ef659bb0b506 to your computer and use it in GitHub Desktop.
Save jinwoo/bcb6e4ebe205cf823482ef659bb0b506 to your computer and use it in GitHub Desktop.
for (const asset of ['/static/awesome.css', '/static/unicorn.png']) {
// stream is a ServerHttp2Stream.
stream.pushStream({':path': asset}, (err, pushStream) => {
if (err) throw err;
pushStream.respondWithFile(asset);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment