1
0

nitro.config.ts 702 B

1234567891011121314151617181920
  1. import errorHandler from './error';
  2. process.env.COMPATIBILITY_DATE = new Date().toISOString();
  3. export default defineNitroConfig({
  4. devErrorHandler: errorHandler,
  5. errorHandler: '~/error',
  6. routeRules: {
  7. '/api/**': {
  8. cors: true,
  9. headers: {
  10. 'Access-Control-Allow-Credentials': 'true',
  11. 'Access-Control-Allow-Headers':
  12. 'Accept, Authorization, Content-Length, Content-Type, If-Match, If-Modified-Since, If-None-Match, If-Unmodified-Since, X-CSRF-TOKEN, X-Requested-With',
  13. 'Access-Control-Allow-Methods': 'GET,HEAD,PUT,PATCH,POST,DELETE',
  14. 'Access-Control-Allow-Origin': '*',
  15. 'Access-Control-Expose-Headers': '*',
  16. },
  17. },
  18. },
  19. });