hyperdrive-http icon indicating copy to clipboard operation
hyperdrive-http copied to clipboard

split the methods out so that we can use custom routes

Open okdistribute opened this issue 8 years ago • 0 comments

For example, adding a few functions: .get(key).pipe(res), .file(key, filename).pipe(res)

var hyperdrivehttp = require('hyperdrive-http')
var express = require('express')

var router = express()
var drive = hyperdrivehttp(getArchive)

router.get('/hi/:key', function (req, res) {
  drive.get(req.params.key).pipe(res)
})

okdistribute avatar Feb 10 '17 23:02 okdistribute