Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ngerakines/tram
A read-through HTTP GET cache.
https://github.com/ngerakines/tram
Last synced: 7 days ago
JSON representation
A read-through HTTP GET cache.
- Host: GitHub
- URL: https://github.com/ngerakines/tram
- Owner: ngerakines
- License: mit
- Created: 2014-04-10T17:41:12.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2014-07-22T15:54:22.000Z (over 10 years ago)
- Last Synced: 2024-11-09T09:44:22.456Z (2 months ago)
- Language: Go
- Size: 637 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# tram
Tram is a small daemon that will download and cache HTTP GET requests for later use.
# Usage
To populate content, make a POST request with a `url` field containing the url that the HTTP GET request should be made to and one or more alias fields.
$ curl --data "alias=&url=http://ngerakines.me/" http://localhost:3000/
To fetch the content, make an HTTP GET request with the `url` query string parameter of the url that has been cached.
$ curl http://localhost:3000/?url=http%3A%2F%2Fngerakines.me%2F
This daemon also supports HEAD requests to determine if a file has been cached or not.
$ curl -X HEAD http://localhost:3000/?url=http%3A%2F%2Fngerakines.me%2F
When attempting GET or HEAD requests, a 404 is returned if the file has not been cached.
# License
The MIT License (MIT)
Copyright (c) 2014 Nick Gerakines