fix(presi): resolve CORS issues and add strictPort to all web apps

- Add port 5180 to CORS_ORIGINS in .env.development
- Add port 5178 to Presi backend CORS config
- Fix Presi API client to use /api prefix
- Add strictPort: true to all web app vite configs to prevent port switching:
  - manacore: 5173
  - chat: 5174
  - picture: 5175
  - manadeck: 5176
  - zitare: 5177
  - presi: 5178
  - voxel-lava: 5180

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Till-JS 2025-11-29 06:58:00 +01:00
parent 4eed41499a
commit 655da23d14
10 changed files with 27 additions and 4 deletions

View file

@ -38,7 +38,7 @@ JWT_ACCESS_TOKEN_EXPIRY=15m
JWT_REFRESH_TOKEN_EXPIRY=7d
JWT_ISSUER=manacore
JWT_AUDIENCE=manacore
CORS_ORIGINS=http://localhost:3000,http://localhost:3002,http://localhost:5173,http://localhost:5174,http://localhost:5175,http://localhost:5176,http://localhost:5177,http://localhost:5178,http://localhost:5179,http://localhost:8081
CORS_ORIGINS=http://localhost:3000,http://localhost:3002,http://localhost:5173,http://localhost:5174,http://localhost:5175,http://localhost:5176,http://localhost:5177,http://localhost:5178,http://localhost:5179,http://localhost:5180,http://localhost:8081
CREDITS_SIGNUP_BONUS=150
CREDITS_DAILY_FREE=5
RATE_LIMIT_TTL=60

View file

@ -3,6 +3,10 @@ import { defineConfig } from 'vite';
export default defineConfig({
plugins: [sveltekit()],
server: {
port: 5174,
strictPort: true,
},
ssr: {
noExternal: [
'marked',

View file

@ -5,10 +5,10 @@ export default defineConfig({
plugins: [sveltekit()],
server: {
port: 5173,
strictPort: false,
strictPort: true,
},
preview: {
port: 4173,
strictPort: false,
strictPort: true,
},
});

View file

@ -3,6 +3,10 @@ import { defineConfig } from 'vite';
export default defineConfig({
plugins: [sveltekit()],
server: {
port: 5176,
strictPort: true,
},
ssr: {
noExternal: [
'@manacore/shared-theme',

View file

@ -4,4 +4,8 @@ import { defineConfig } from 'vite';
export default defineConfig({
plugins: [tailwindcss(), sveltekit()],
server: {
port: 5175,
strictPort: true,
},
});

View file

@ -11,6 +11,7 @@ async function bootstrap() {
'http://localhost:3000',
'http://localhost:5173',
'http://localhost:5177',
'http://localhost:5178', // Presi web app
'http://localhost:8081',
'exp://localhost:8081',
'http://localhost:3001', // Mana Core Auth

View file

@ -10,7 +10,8 @@ import type {
ReorderSlidesDto,
} from '@presi/shared';
const API_URL = PUBLIC_BACKEND_URL || 'http://localhost:3008';
const BASE_URL = PUBLIC_BACKEND_URL || 'http://localhost:3008';
const API_URL = `${BASE_URL}/api`;
const AUTH_URL = PUBLIC_MANA_CORE_AUTH_URL || 'http://localhost:3001';
function getToken(): string | null {

View file

@ -6,6 +6,7 @@ export default defineConfig({
plugins: [sveltekit()],
server: {
port: 5178,
strictPort: true,
fs: {
allow: [
// Allow serving files from the monorepo root node_modules

View file

@ -3,6 +3,10 @@ import { defineConfig } from 'vite';
export default defineConfig({
plugins: [sveltekit()],
server: {
port: 5177,
strictPort: true,
},
ssr: {
noExternal: [
'@zitare/shared',

View file

@ -3,4 +3,8 @@ import { defineConfig } from 'vite';
export default defineConfig({
plugins: [sveltekit()],
server: {
port: 5180,
strictPort: true,
},
});