drunomics / nuxtjs-drupal-ce

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

Make use of nitro server API routes #165

Closed fago closed 9 months ago

fago commented 1 year 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 1 year ago

Implementation plan:

Document "Customizing API route rules"

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

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

fago commented 9 months ago

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