Open
Description
It is important to handle redirects for the production website to avoid having the .pages.dev
alias and automating it might not be the best way.
This is one example:
const DOMAIN = 'admin.hub.nuxt.com'
export default defineEventHandler(async (event) => {
const host = getRequestHost(event)
if (import.meta.prerender || import.meta.dev || ['localhost', DOMAIN].includes(host)) {
return
}
if (useRuntimeConfig().hub.env === 'production') {
return sendRedirect(event, 'https://' + DOMAIN + event.path, 301)
}
})