Feat: Agregar CORS para endpoints de API externa
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:
2025-12-04 16:42:05 -06:00
parent 0edec1e975
commit 939cc8e08c

View File

@@ -48,6 +48,23 @@ export default defineNuxtConfig({
openAPI: true openAPI: true
}, },
routeRules: { 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': { '/manifest.webmanifest': {
headers: { headers: {
'Content-Type': 'application/manifest+json', 'Content-Type': 'application/manifest+json',