drunomics / nuxtjs-drupal-ce

A Nuxt module to easily connect Drupal via custom elements.
https://lupus-decoupled.org/
MIT License
22 stars 4 forks source link

Make use of nitro server API routes #165

Closed fago closed 4 months ago

fago commented 12 months ago

Idea: Introduce server API that proxies requests through the Drupal backend

/api/drupal/* ---> drupal/  (no cache by default)
/api/drupal-ce/   ---> drupal/ce-api/  (no cache by default)
/api/menu/{name} ---> drupal/api/rest_menu_items/{name}   (cached 5min by default, if possible disabled in dev)

Advantages:

Requirements:

fago commented 12 months ago

Implementation plan:

Document "Customizing API route rules"

export default defineNuxtConfig({
  routeRules: {
    '/drupal-ce/**': { swr: true },
  }
})
StirStudios commented 12 months ago

Ah this is a great idea. I was going to ask about this.

fago commented 4 months ago

this is shipped in https://github.com/drunomics/nuxtjs-drupal-ce/releases/tag/v2.0.0-beta4