+
+ Nuxt module playground!
+
+
+
+
diff --git a/playground/nuxt.config.ts b/playground/nuxt.config.ts
new file mode 100644
index 0000000..c602b24
--- /dev/null
+++ b/playground/nuxt.config.ts
@@ -0,0 +1,13 @@
+import { defineNuxtConfig } from 'nuxt/config'
+import MyModule from '..'
+
+export default defineNuxtConfig({
+ modules: [MyModule],
+ basicAuth: {
+ password: 'password',
+ username: 'username',
+ realm: 'defaultRealm',
+ excludedRoutes: ['/health'],
+ enableOnDev: false
+ }
+})
diff --git a/playground/package.json b/playground/package.json
new file mode 100644
index 0000000..bd35a58
--- /dev/null
+++ b/playground/package.json
@@ -0,0 +1,4 @@
+{
+ "private": true,
+ "name": "playground"
+}
diff --git a/playground/server/routes/health.ts b/playground/server/routes/health.ts
new file mode 100644
index 0000000..fac6903
--- /dev/null
+++ b/playground/server/routes/health.ts
@@ -0,0 +1,7 @@
+import { defineEventHandler } from 'h3'
+
+export default defineEventHandler(() => {
+ return {
+ state: 'healthy'
+ }
+})
diff --git a/src/module.ts b/src/module.ts
new file mode 100644
index 0000000..048bc95
--- /dev/null
+++ b/src/module.ts
@@ -0,0 +1,57 @@
+import { defineNuxtModule, addServerHandler, createResolver } from '@nuxt/kit'
+import { defu } from 'defu'
+
+export interface ModuleOptions {
+ username?: string
+ password?: string
+ realm: string
+ whitelistedRoutes: string[]
+ enabled: boolean
+}
+
+export default defineNuxtModule