Skip to content

Instantly share code, notes, and snippets.

@joelrobotham
Last active July 18, 2017 03:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joelrobotham/d706b631032d8a0a7828037db24bb910 to your computer and use it in GitHub Desktop.
Save joelrobotham/d706b631032d8a0a7828037db24bb910 to your computer and use it in GitHub Desktop.
const staticAssetsFromFilesystem = { /* Express static asset serving middleware */ };
const fallbackToStaticAssetsFromS3 = { /* Custom middleware that calls out to S3 */ };
app.use(`/public`, staticAssetsFromFilesystem, fallbackToStaticAssetsFromS3);
'X-Served-From': 'fallback'
appLogger.log("Fallback static asset retrieved from: " + url);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment