Closed dwu359 closed 1 year ago
Hello @dwu359! Thank you for submitting the Feature Request Form. We appreciate your contribution. :wave:
We will look into it and provide a response as soon as possible.
To work on this feature request, you can follow these branch setup instructions:
Checkout the main branch:
git checkout nextjs
Pull the latest changes from the remote main branch:
git pull origin nextjs
Create a new branch specific to this feature request using the issue number:
git checkout -b feature-917
Feel free to make the necessary changes in this branch and submit a pull request when you're ready.
Best regards, Deep Learning Playground (DLP) Team
will the api endpoint base url be a constant? @dwu359
will the api endpoint base url be a constant? @dwu359
Did we end up deciding this?
noah merged this PR in
Feature Name
Handle File Uploading on Frontend Using SST Endpoints
Your Name
Daniel Wu
Description
The presigned upload url endpoint has been migrated from the backend to SST already. You can access it using the prod endpoint
https://em9iri9g4j.execute-api.us-west-2.amazonaws.com/
with routeGET /datasets/user/{type}/{filename}/presigned_upload_url
. Keep in mind that this endpoint requires a bearer token for authentication.The frontend also currently uses RTK Queries to send requests to the backend. It's like
fetch
oraxios
but it is easier to integrate with Redux and has extra features. You may find theRedux Devtools
extension also helpful.This medium article is also pretty good at explaining how AWS presigned urls work: https://medium.com/@aidan.hallett/securing-aws-s3-uploads-using-presigned-urls-aa821c13ae8d
Modify the uploadDatasetFile RTK Query in
frontend/src/features/Train/redux/trainspaceApi.ts
to use the SST presigned_upload_url endpoint to upload user dataset files.