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.
yarn add koa-vault
// ecmascript module
import vault from 'koa-vault'
// commonjs
const vault = require('koa-vault')
app.use(
vault({
directory: './vault', // default
offline: false //default
})
)
β 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.
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.