Skip to content

NasonTech/nuxt-cors

Repository files navigation

Nuxt CORS

npm version npm downloads License Nuxt

React to app updates.

Features

Respond to new versions of your application.

Quick Setup

Install the module to your Nuxt application with one command:

npx nuxi module add @nasontech/nuxt-cors

That's it! You can now configure CORS rules in your Nuxt app ✨

type CORSModuleOptions = {
	rules?: CORSRouteRule[]
	options?: H3CorsOptions
}

type CORSRouteRule = {
	path: string | RegExp | RegExp[]
	options: H3CorsOptions
}

Example:

    cors: [
        {
            path: /^\/api/,
            options: {
                origin: ['https://example.com', 'https://corp.org']
            }
        }
    ]

Contribution

Local development
# Install dependencies
npm install

# Generate type stubs
npm run dev:prepare

# Develop with the playground
npm run dev

# Build the playground
npm run dev:build

# Run ESLint
npm run lint

# Run Vitest
npm run test
npm run test:watch

# Release new version
npm run release

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published