Skip to content

Conversation

@arkml
Copy link
Contributor

@arkml arkml commented Sep 19, 2025

No description provided.

@vercel
Copy link

vercel bot commented Sep 19, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
rowboat Ready Ready Preview Comment Sep 26, 2025 2:32pm

// Require authentication if enabled
try {
if (USE_AUTH) {
await authCheck();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we shouldn't use server actions in api route context. As an example of how to use auth within an API route, see how its done in copilot response api:
https://github.com/rowboatlabs/rowboat/blob/main/apps/rowboat/app/api/copilot-stream-response/%5BstreamId%5D/route.ts#L11

const baseKey = `uploaded_images/${dirA}/${dirB}/${id}`;

// Try known extensions in order
const exts = ['.png', '.jpg', '.webp', '.bin'];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we get rid of this logic and have the image extension be a part of id?

// Accepts an image file (multipart/form-data, field name: "file")
// Stores it either in S3 (if configured) under uploaded_images/<a>/<b>/<uuid>.<ext>
// or in the in-memory temp cache. Returns a JSON with a URL that the agent can fetch.
export async function POST(request: NextRequest) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assuming we get a presigned upload url from s3, why do we need this route to exist at all? Wouldn't the frontend directly upload to the presigned url?

@@ -0,0 +1,57 @@
import { NextRequest, NextResponse } from 'next/server';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should not exist as an API route, but instead as a server action

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants