-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add redirect to Circulars archive tarballs in static bucket
API Gateways have a limit on response size of 10 MB, so we cannot rely on the API Gateway to server the Circulars archive.
- Loading branch information
Showing
5 changed files
with
76 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/*! | ||
* Copyright © 2023 United States Government as represented by the | ||
* Administrator of the National Aeronautics and Space Administration. | ||
* All Rights Reserved. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
import { type LoaderArgs, redirect } from '@remix-run/node' | ||
import invariant from 'tiny-invariant' | ||
|
||
import { region, staticBucket } from '~/lib/env.server' | ||
import { getBucketKey } from '~/scheduled/circulars/uploadTar' | ||
|
||
function getBucketUrl(region: string, bucket: string, key: string) { | ||
return `https://s3.${region}.amazonaws.com/${bucket}/key` | ||
} | ||
|
||
export async function loader({ params: { suffix } }: LoaderArgs) { | ||
invariant(suffix) | ||
return redirect(getBucketUrl(region, staticBucket, getBucketKey(suffix))) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters