Skip to content

🤖 Release PR#1

Open
github-actions[bot] wants to merge 2375 commits into
productionfrom
master
Open

🤖 Release PR#1
github-actions[bot] wants to merge 2375 commits into
productionfrom
master

Conversation

@github-actions
Copy link
Copy Markdown

@github-actions github-actions Bot commented Oct 2, 2023

No description provided.

benfurber and others added 30 commits August 27, 2023 19:35
…s-component

feat: add generic error rendering component
…-roles-not-authorizing-in-dev

fix: roles required checked in dev view correctly
refactor: remove unnecessary argument and add unit tests
…kelaar

docs: add benkelaar as a contributor for code
…gins

fix: replace margins with paddings in research comments box section
…esearch_listing

feat: add tooltips to research and howto cards
thisislawatts and others added 28 commits September 30, 2023 15:57
…ents

feat: display MapPin moderator comments
…ion-comments

feat(components): display moderation comments on MapMemberCard
…und-testijg

docs: update guidance around testing
…tion-verified

feat: adds email notification when verified badge added
…ts-emails

feat(emails): needs improvements emails
test: add error handling and testing for getEmailTemplate
…limit-moderation-emails

fix: memory and file path
…hurtyukayev

docs: add arthurtyukayev as a contributor for code
…to_footer

Feat: remove howto footer, add comment focus
…id-char-signup

fix: prevent signup if username contains invalid characters
Comment on lines +35 to +72
app.use('*', async (req, res, next) => {
const url = req.originalUrl
try {
// 1. Read index.html
let template = fs.readFileSync(
path.resolve(__dirname, 'index.html'),
'utf-8',
)

// 2. Apply Vite HTML transforms. This injects the Vite HMR client,
// and also applies HTML transforms from Vite plugins, e.g. global
// preambles from @vitejs/plugin-react
template = await vite.transformIndexHtml(url, template)

// 3. Load the server entry. ssrLoadModule automatically transforms
// ESM source code to be usable in Node.js! There is no bundling
// required, and provides efficient invalidation similar to HMR.
const { render } = await vite.ssrLoadModule(
path.resolve(__dirname, './entry-server.mjs'),
)

// 4. render the app HTML. This assumes entry-server.js's exported
// `render` function calls appropriate framework SSR APIs,
// e.g. ReactDOMServer.renderToString()
const appHtml = await render(url)

// 5. Inject the app-rendered HTML into the template.
const html = template.replace(`<!--ssr-outlet-->`, appHtml)

// 6. Send the rendered HTML back.
res.status(200).set({ 'Content-Type': 'text/html' }).end(html)
} catch (e) {
// If an error is caught, let Vite fix the stack trace so it maps back
// to your actual source code.
vite.ssrFixStacktrace(e)
next(e)
}
})

Check failure

Code scanning / CodeQL

Missing rate limiting

This route handler performs [a file system access](1), but is not rate-limited.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.