Skip to content

Improve Netlify workflow documentation and preview server#8

Open
attaboy11 wants to merge 1 commit into
mainfrom
codex/initialize-codex-solar-project-kn4fxr
Open

Improve Netlify workflow documentation and preview server#8
attaboy11 wants to merge 1 commit into
mainfrom
codex/initialize-codex-solar-project-kn4fxr

Conversation

@attaboy11
Copy link
Copy Markdown
Owner

Summary

  • document local dev, production preview, and Netlify troubleshooting guidance in the README
  • add a lightweight Node-based static preview server and wire it to the npm start/preview scripts
  • commit the npm lockfile so Netlify reliably detects the workspace root

Testing

  • npm run build

Codex Task

@vercel
Copy link
Copy Markdown

vercel Bot commented Nov 14, 2025

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

Project Deployment Preview Comments Updated (UTC)
aigiftgen Error Error Nov 14, 2025 11:24am
aigiftgen-qtxz Ready Ready Preview Comment Nov 14, 2025 11:24am

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/serve-out.mjs
Comment on lines +50 to +60
const requestUrl = new URL(req.url, `http://${req.headers.host ?? `localhost:${port}`}`);
let pathname = requestUrl.pathname;

if (pathname.endsWith("/")) {
pathname = `${pathname}index.html`;
}

const decodedPath = decodeURIComponent(pathname);
const safePath = normalize(join(outDir, decodedPath));

if (!safePath.startsWith(outDir)) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Strip leading slash before joining request path

The preview server never serves any file because decodedPath always begins with /, so join(outDir, decodedPath) returns the absolute decoded path (e.g. /index.html) and the subsequent startsWith(outDir) check fails. As a result every request is rejected with 403 and the preview server advertised in the README cannot be used at all. Remove the leading slash (or otherwise ensure the second argument to join is relative) before calling join so generated paths stay under outDir.

Useful? React with 👍 / 👎.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant