mantis-app
Version:
M.A.N.T.I.S (MongoDB, Analog, Nx, Tailwind CSS, Ionic, Storybook) is not just a CLI tool; it's your passport to a seamless full-stack project launch.
15 lines (12 loc) • 399 B
text/typescript
import { defineEventHandler, handleCors } from 'h3';
const frontendUrls = import.meta.env.FRONTEND_URLS;
if (typeof frontendUrls !== 'string') {
throw new Error('FRONTEND_URLS environment variable is not set');
}
export default defineEventHandler((event) => {
handleCors(event, {
methods: '*',
allowHeaders: '*',
origin: frontendUrls.split(',').map((url) => url.trim()),
});
});