Closed
Description
I setup my S3 with :
index.html as index and error file.
Then I setup my Cloudfront distribution with a Origin Request Lambda@Edge function (node20) like this :
import path from 'path';
export const handler = async (event, context, callback) => {
const { request } = event.Records[0].cf;
const { uri, headers } = request;
if (uri !== "" && uri !== "/" && !uri.includes('.')) {
request.uri += '.html';
}
return request;
};
And everything worked then.
Thanks for your repo. Actually, it's insane that building a static site is not more obvious/straightforward when we're using react + vite project. Happily you made this repo 🔥 (I created a thread in react.dev about this last part : reactjs/react.dev#7155)
Metadata
Metadata
Assignees
Labels
No labels