@erpgap/nuxt-routes-generator
v0.0.1-alpha.1
Published
Nuxt module for generating dynamic routes from Odoo GraphQL API
Readme
Erpgap Routes Generator
A Nuxt module that automatically generates dynamic routes from Odoo GraphQL API for categories and products.
Features
- Automatically generates routes for categories and products
- Configurable page sizes and file paths
- TypeScript support
- Environment variables support
Setup
- Add
erpgap-routes-generatordependency to your project
npm install erpgap-routes-generator
# or
yarn add erpgap-routes-generator- Add
erpgap-routes-generatorto themodulessection ofnuxt.config.ts
export default defineNuxtConfig({
modules: ['erpgap-routes-generator'],
routesGenerator: {
odooBaseUrl: 'your-odoo-graphql-endpoint',
categoryPageSize: 10000,
productPageSize: 10000,
categoryPageFile: '~/pages/category/[id].vue',
productPageFile: '~/pages/product/[slug].vue'
}
})Environment Variables
The module supports the following environment variables:
NUXT_PUBLIC_ODOO_BASE_URL: Base URL for Odoo GraphQL APINUXT_PUBLIC_CATEGORY_PAGE_SIZE: Number of categories to fetchNUXT_PUBLIC_PRODUCT_PAGE_SIZE: Number of products to fetchNUXT_PUBLIC_CATEGORY_PAGE_FILE: Path to category page componentNUXT_PUBLIC_PRODUCT_PAGE_FILE: Path to product page component
