Closed Tzal3x closed 1 month ago
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
walrus-site | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Jul 30, 2024 8:33am |
Base skeleton is there. It doesn't work yet, something wrong happens with the url parsing.
Issues:
splitUrl
in domain_parsing.ts, it seens only as if I'm hitting http://localhost:3000/. Subdomains are ignored. Another article to consider: nextjs wildcard subdomains
⚠️ Looks like subdomains don't work with safari.
i.e. http://docs.localhost:3000/ returns this error:
Safari can't find server. Safari can't find the server docs.localhost
⚠️ There seems to be an infinite loop occurring when I'm running an instance of the server's production build (pnpm run start
). It doesn't occur on development mode (pnpm run dev
).
Sample output:
...
Trying to extract the walrus link from: http://localhost:3000/service-worker.js
Trying to extract the sui link from: http://localhost:3000/service-worker.js
Trying to extract the walrus link from: http://localhost:3000/service-worker.js
Trying to extract the sui link from: http://localhost:3000/service-worker.js
Trying to extract the walrus link from: http://localhost:3000/service-worker.js
Trying to extract the sui link from: http://localhost:3000/service-worker.js
Trying to extract the walrus link from: http://localhost:3000/service-worker.js
Trying to extract the sui link from: http://localhost:3000/service-worker.js
Trying to extract the walrus link from: http://localhost:3000/service-worker.js
Trying to extract the sui link from: http://localhost:3000/service-worker.js
...
⚠️ There seems to be an infinite loop occurring when I'm running an instance of the server's production build (
pnpm run start
). It doesn't occur on development mode (pnpm run dev
).
🎉 Fixed - I created this post that explains it.
did you add the settings to .editorconfig? if so, can you commit them?
@giac-mysten I actually just removed the prettierrc file because it was redundant after I compared them.
Create a nextjs server that acts as a server-side walrus-sites portal. It works by combining a middleware for preprocessing the requests, and a root endpoint (defined in
route.ts
) that actually contains the logic as the service worker did.The middleware has the following role:
http://<name>.walrus.site/path/to/file/
without throwing an error. Explanation: if you don't define a route on nextjs, the default logic is to throw an error because the/path/to/file
endpoint does not exist.In summary, the middleware is just a delegator and an error-preventer of the original url.
💁♂️ Review tip: the PR consists of 2 commits. I would suggest reviewing commit by commit and not the whole PR altogether.