diff --git a/package-lock.json b/package-lock.json index ae45c98..97aa286 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,6 +15,7 @@ "@nestjs/config": "3.2.2", "@nestjs/core": "10.3.8", "@nestjs/platform-express": "10.3.8", + "@nestjs/serve-static": "^4.0.2", "@nestjs/swagger": "^7.3.1", "@nestjs/terminus": "10.2.3", "@types/cache-manager-redis-store": "2.0.4", @@ -1984,6 +1985,37 @@ "integrity": "sha512-AilxAyFOAcK5wA1+LeaySVBrHsGQvUFCDWXKpZjzaL0PqW+xfBOttn8GNtWKFWqneyMZj41MWF9Kl6iPWLwgOA==", "dev": true }, + "node_modules/@nestjs/serve-static": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@nestjs/serve-static/-/serve-static-4.0.2.tgz", + "integrity": "sha512-cT0vdWN5ar7jDI2NKbhf4LcwJzU4vS5sVpMkVrHuyLcltbrz6JdGi1TfIMMatP2pNiq5Ie/uUdPSFDVaZX/URQ==", + "dependencies": { + "path-to-regexp": "0.2.5" + }, + "peerDependencies": { + "@fastify/static": "^6.5.0 || ^7.0.0", + "@nestjs/common": "^9.0.0 || ^10.0.0", + "@nestjs/core": "^9.0.0 || ^10.0.0", + "express": "^4.18.1", + "fastify": "^4.7.0" + }, + "peerDependenciesMeta": { + "@fastify/static": { + "optional": true + }, + "express": { + "optional": true + }, + "fastify": { + "optional": true + } + } + }, + "node_modules/@nestjs/serve-static/node_modules/path-to-regexp": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.2.5.tgz", + "integrity": "sha512-l6qtdDPIkmAmzEO6egquYDfqQGPMRNGjYtrU13HAXb3YSRrt7HSb1sJY0pKp6o2bAa86tSB6iwaW2JbthPKr7Q==" + }, "node_modules/@nestjs/swagger": { "version": "7.3.1", "resolved": "https://registry.npmjs.org/@nestjs/swagger/-/swagger-7.3.1.tgz", diff --git a/package.json b/package.json index 1b2b117..777c3dd 100644 --- a/package.json +++ b/package.json @@ -29,6 +29,7 @@ "@nestjs/config": "3.2.2", "@nestjs/core": "10.3.8", "@nestjs/platform-express": "10.3.8", + "@nestjs/serve-static": "^4.0.2", "@nestjs/swagger": "^7.3.1", "@nestjs/terminus": "10.2.3", "@types/cache-manager-redis-store": "2.0.4", diff --git a/public/index.html b/public/index.html new file mode 100644 index 0000000..5d89bf1 --- /dev/null +++ b/public/index.html @@ -0,0 +1,41 @@ + + + + NestJS Playground + + + +
+

Welcome to the NestJS Playground

+

Please find the documentation for our modules below:

+ PrimeModule Documentation + Auth0Module Documentation +
+ + diff --git a/src/app.module.ts b/src/app.module.ts index 337fd08..dd1682f 100644 --- a/src/app.module.ts +++ b/src/app.module.ts @@ -1,9 +1,11 @@ import { Module } from '@nestjs/common'; +import { ServeStaticModule } from '@nestjs/serve-static'; import { HealthModule } from './core/health/health.module'; import { ConditionalModule, ConfigModule } from '@nestjs/config'; import { LoggerConfig } from './core/logger/logger.config'; import { PrimeModule } from './modules/prime/prime.module'; import { Auth0Module } from './modules/auth0/auth0.module'; +import { join } from 'path'; const conditionalModules = [PrimeModule, Auth0Module]; const registerConditionalModules = conditionalModules.map((module) => @@ -17,6 +19,9 @@ const registerConditionalModules = conditionalModules.map((module) => @Module({ imports: [ + ServeStaticModule.forRoot({ + rootPath: join(__dirname, '..', 'public'), + }), ConfigModule.forRoot({ isGlobal: true, cache: true,