Skip to content
πŸ— Archive Koa responses, for historical purposes.
JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.eslintrc.json
.gitignore
.huskyrc.json
.lintstagedrc.json
.npmrc
.prettierignore
.prettierrc.json
.travis.yml
CHANGELOG.md
README.md
index.js
package.json

README.md

πŸ— Koa Vault

Archive Koa responses, for historical purposes.

This project will save JSON responses to a local directory, which can be later used when the API is decommissioned. Read about why this project was created here.

Could be used with koa-proxy to scrape arbitrary API's.

Installation

yarn add koa-vault

Usage

// ecmascript module
import vault from 'koa-vault'

// commonjs
const vault = require('koa-vault')

app.use(
  vault({
    directory: './vault', // default
    offline: false //default
  })
)

Saved files

β†’ program β†’ mulatu-astatke.json
β†’ program β†’ nakhane.json
β†’ program β†’ neneh-cherry.json
β†’ program β†’ oneohtrix-point-never.json

JSON files will be saved to the vault directory. Due to file naming conventions, forward slashes are replaced with forward arrows (β†’), and question marks with question blocks (β–‘).

Only GET requests with application/json content-type header responses will be saved. If this does not suit your needs, please open a pull request.

Offline/archive

When turning the offline option on, GET requests will be served from the vault directory. If the file does not exist, a 404 error will be thrown.

You can’t perform that action at this time.