Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MyMeta] Migrate the web3.storage proxy from Express to Next.js #848

Closed
dysbulic opened this issue Sep 29, 2021 · 1 comment · Fixed by #943
Closed

[MyMeta] Migrate the web3.storage proxy from Express to Next.js #848

dysbulic opened this issue Sep 29, 2021 · 1 comment · Fixed by #943

Comments

@dysbulic
Copy link
Member

web3.storage authenticates using an API key. That key can't be inserted into the React app or users would be able to delete each other's files.

To protect the key, a proxy is used where the user sends to the proxy and the proxy uploads to web3.storage returning the CIDs of where the files are stored.

@Cali93 & I put the proxy code in the Express server just to get it working. That Express server is deployed to a private subnet only accessible to Hasura in production, so it can't be used as the proxy.

It should be possible to migrate the proxy code to a Next.js API endpoint. web3.storage requires Webpack 5 (and MyMeta is on 4 currently), but it oughtn't be used for the API endpoints.

@dysbulic
Copy link
Member Author

A Next.js API endpoint fronting web3.storage is part of Ceramic's NFT Example: https://github.com/ceramicstudio/dynamic-nft-example/blob/main/pages/api/persist.ts

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 a pull request may close this issue.

2 participants