Hacker News new | ask | show | jobs
by acemarke 2344 days ago
Off the top of my head, the import logic could be something like:

    if(__DEV__) {
        require("loadApiMocking");
    }
Agreed that there'd be work to do to keep real code responses and mocked responses in sync, but there's probably ways to automate that if you want. In fact, I can hypothetically imagine some way to introspect OpenAPI schema files and configure Mirage accordingly.