@adaptic/backend-legacy 0.0.52 → 0.0.53
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/server.cjs +3 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adaptic/backend-legacy",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.53",
|
|
4
4
|
"description": "Backend executable CRUD functions with dynamic variables construction, and type definitions for the Adaptic AI platform.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "index.d.ts",
|
package/server.cjs
CHANGED
|
@@ -126,7 +126,9 @@ const startServer = async () => {
|
|
|
126
126
|
// Health check endpoint - mounted before Apollo middleware so it's not behind GraphQL or auth
|
|
127
127
|
app.use((0, health_1.createHealthRouter)());
|
|
128
128
|
// Configure CORS with allowed origins
|
|
129
|
-
const
|
|
129
|
+
const defaultOrigins = ['http://localhost:3000', 'http://localhost:3001', 'https://adaptic.ai', 'https://api.adaptic.ai'];
|
|
130
|
+
const envOrigins = process.env.ALLOWED_ORIGINS ? process.env.ALLOWED_ORIGINS.split(',').map(o => o.trim()) : [];
|
|
131
|
+
const allowedOrigins = [...new Set([...defaultOrigins, ...envOrigins])];
|
|
130
132
|
const corsOptions = {
|
|
131
133
|
origin: (origin, callback) => {
|
|
132
134
|
// Allow requests with no origin (mobile apps, server-to-server, curl)
|