-
-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers
Description
When responding to API requests with a file a convenience method would be nice that sets the appropriate response headers for a redirect and returns the pre-signed read URL.
Dev experience should be something like this:
import { api, bucket } from "@nitric/sdk";
const files = bucket('files').for('reading');
const fileApi = api('file-api');
fileApi.get("/files/:filename", async (ctx) => {
const { filename } = ctx.req.params;
const file = files.file(filename)
ctx.res.file(file);
});Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers