Skip to content

Enable module to work with Nitro routeRules #64

@AndersCV

Description

@AndersCV

Describe the feature

Would it be possible to extend functionality so that /api/__api_party/${endpointId} routes can be cached in nitro by routeRules that we can define in nuxt.config.ts?

I don't have much knowledge about the inner workings of Nuxt and Nitro so maybe this is not possible to modules but it seems like this would be a great benefit.

Currently in my project I have a bunch for endpoints delivering some SEO content that I would like to cache for an extended period of time. Currently it doesn't seem possible to use the api-party composables fetch this data and have it cached by Nitro. This means I have to manually create endpoints in my server/api folder and use a mix of useFetch for cacheable endpoints and api-party composables for non-cachable endpoints which leads to a very confusing DX.

Additional information

  • Would you be willing to help implement this feature?
  • Can you think of other implementations of this feature?

Final checks

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions