mirror of
https://github.com/kamask-dev/pchelpmaster.git
synced 2026-11-11 05:49:38 +00:00
Add proxy.conf.mjs mirroring `location /pb/` from nginx: the prefix is stripped, target comes from PB_URL (empty value falls back to the default, same as the SSR provider). Cover the config with tests in tests/lint and update docs. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
12 lines
558 B
JavaScript
12 lines
558 B
JavaScript
// @ts-check
|
|
// Повторяет `location /pb/` из docs/architecture.md (раздел 7): только пути с префиксом `/pb/`, префикс срезается.
|
|
// Формат — `server.proxy` dev-сервера Vite (@angular/build).
|
|
/** @type {Record<string, { target: string; changeOrigin?: boolean; rewrite?: (path: string) => string }>} */
|
|
export default {
|
|
'/pb/': {
|
|
target: process.env['PB_URL'] || 'http://127.0.0.1:8090',
|
|
changeOrigin: true,
|
|
rewrite: (path) => path.replace(/^\/pb/, ''),
|
|
},
|
|
};
|