JSFiddle - React, Tailwind, and code Playground
JavaScript
// import path from 'path';
import { HttpCachingProxy } from '@loopback/http-caching-proxy';
const proxy = new HttpCachingProxy({
// directory where to store recorded snapshots - required
// cachePath: path.resolve(__dirname, '.proxy-cache'),
cachePath: './tmp/proxy-cache',
// port where to listen - 0 by default
port: 8080,
// how often to re-validate snapshots (in milliseconds) - one day by default
ttl: 24 * 60 * 60 * 1000,
});
await proxy.start();
// execute with: node tmp/loopback-http-caching-proxy.js