Web request redirection! Intended for use inside webworker environment.
- fetch
- Response
- addEventListener
b2Backblaze B2- Dropbox
[] Make it easy to redirect to any web folder. Like raw.github.
Import or require into your project.
const { getProxyInfo, registerFunction } = require('sheave')Make a addRouteInfo function. The function accepts an object that contains information about the request. It must return an object that will be merged in. If you do not need different options for various routes do something like this with lodash _.contant.
const getRouteInfo = _.constant({
accessToken: process.env.DROPBOX_TOKEN,
provider: 'dropbox',
pathTemplate: ({ pathname }) => `/dumper${pathname}`,
})Then you pass your getRouteInfo function to getProxyInfo and send the result of that to registerFunction.
const getInfo = getProxyInfo(getRouteInfo)
registerFunction(getInfo)parse: Path or array paths that should be JSON parsed and added to response object. Example: body or Dropbox-API-Result.
- setWith:
['headers.ETag', 'headers.X-Bz-Content-Sha1', 'etag'] - setWith:
['headers.Content-Type', 'info.pathname', 'mime'] - move:
{ get: '', set: '' } - omit: Array of paths that should always be removed.