Feat: Agregar CORS para endpoints de API externa
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 4m20s
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 4m20s
Configura headers CORS en nuxt.config.ts para permitir llamadas desde otros orígenes a: - /api/messages/send - /api/mcp Esto permite que aplicaciones externas como el sistema de asistencia puedan enviar mensajes de WhatsApp.
This commit is contained in:
@@ -48,6 +48,23 @@ export default defineNuxtConfig({
|
||||
openAPI: true
|
||||
},
|
||||
routeRules: {
|
||||
// CORS para API externa
|
||||
'/api/messages/send': {
|
||||
cors: true,
|
||||
headers: {
|
||||
'Access-Control-Allow-Origin': '*',
|
||||
'Access-Control-Allow-Methods': 'GET, POST, OPTIONS',
|
||||
'Access-Control-Allow-Headers': 'Content-Type, Authorization'
|
||||
}
|
||||
},
|
||||
'/api/mcp': {
|
||||
cors: true,
|
||||
headers: {
|
||||
'Access-Control-Allow-Origin': '*',
|
||||
'Access-Control-Allow-Methods': 'GET, POST, OPTIONS',
|
||||
'Access-Control-Allow-Headers': 'Content-Type, Authorization'
|
||||
}
|
||||
},
|
||||
'/manifest.webmanifest': {
|
||||
headers: {
|
||||
'Content-Type': 'application/manifest+json',
|
||||
|
||||
Reference in New Issue
Block a user