Help us shape the future of Go! Take the 2026 Go Developer Survey

cache-server

command module
v0.0.0-...-1db25f0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 30, 2022 License: MIT Imports: 10 Imported by: 0

README

JSON Cache Server

This simple HTTP server is used to test APIs without hitting request limits.

Usage

  • Create a config file in the same folder as the executable, with the following structure:
{
    "APIURL": "https://<api endpoint>",
    "ServerPort": <server port>,
    "CacheExpiry": <cache expiry in hours>
}
  • Build and run, and use this server's IP address as the new API host;
  • Everything present in the URL's path will be forwarded to the real API, and returned from cache in subsequent requests;
  • Requests are cached by hashing the URL path, and cache expiry is checked per hash, so different endpoints might have different cache expiries;

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL