create-surf-app 0.1.4 → 0.1.5

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.
Files changed (2) hide show
  1. package/dist/index.js +10 -2
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -152,8 +152,16 @@ export default defineConfig({
152
152
  port: FRONTEND_PORT,
153
153
  host: '0.0.0.0',
154
154
  proxy: {
155
- '/proxy': { target: \`http://127.0.0.1:\${BACKEND_PORT}\`, changeOrigin: true },
156
- '/api': { target: \`http://127.0.0.1:\${BACKEND_PORT}\`, changeOrigin: true },
155
+ [\`\${BASE}proxy\`]: {
156
+ target: \`http://127.0.0.1:\${BACKEND_PORT}\`,
157
+ changeOrigin: true,
158
+ rewrite: (p: string) => p.replace(new RegExp(\`^\${BASE.replace(/[.*+?^\${}()|[\\\\]\\\\\\\\]/g, '\\\\\\\\$&')}\`), '/'),
159
+ },
160
+ [\`\${BASE}api\`]: {
161
+ target: \`http://127.0.0.1:\${BACKEND_PORT}\`,
162
+ changeOrigin: true,
163
+ rewrite: (p: string) => p.replace(new RegExp(\`^\${BASE.replace(/[.*+?^\${}()|[\\\\]\\\\\\\\]/g, '\\\\\\\\$&')}\`), '/'),
164
+ },
157
165
  },
158
166
  },
159
167
  resolve: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-surf-app",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "Scaffold a Surf app — Vite + React + Express + @surf-ai/sdk",
5
5
  "type": "module",
6
6
  "bin": {