Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mismith/remote-static
https://github.com/mismith/remote-static
Last synced: 22 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/mismith/remote-static
- Owner: mismith
- Created: 2016-11-30T22:57:55.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2016-11-30T23:46:06.000Z (about 8 years ago)
- Last Synced: 2024-04-24T16:24:40.101Z (9 months ago)
- Language: JavaScript
- Size: 1.95 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# remote-static
Express middleware to proxy-map local URLs to a remote host.
# Usage
Simply specify the remote URL when you add your middleware:
const express = require('express'),
app = express(),
remoteStatic = require('remote-static');app.use(remoteStatic('https://example.com'));
app.listen(3000);Then, if you ping say, `localhost:3000/path/to/asset` and `https://example.com/path/to/asset` exists, it will be served up.
If it doesn't exist, this middleware internally calls `next()` and the request passes through unaffected.