Configuring Proxy for Storybook (Angular + Vite)

Discussão em 'Angular' iniciado por aghwotu, Dezembro 4, 2024.

  1. aghwotu

    aghwotu Guest

    I'm working on setting up Storybook (v8.4.5) with a file upload component that uses Postman Echo API. While the upload works perfectly in my Angular dev environment (port 4200) with this proxy config:

    {
    "/post": {
    "target": "https://postman-echo.com",
    "secure": true,
    "changeOrigin": true
    }
    }


    I can't get the same proxy working in Storybook (port 6006). The request hits http://localhost:6006/post but returns 404. I've tried:

    • Setting proxy in .storybook/preview.ts
    • Creating a vite.config.ts in the root directory with proxy settings and updating .storybook/main.ts

    Any suggestions on getting the proxy to work in Storybook with Vite? Thank you in advance!

    Continue reading...

Compartilhe esta Página