nestjs-telescope
Version:
A debugging and monitoring tool for NestJS applications, inspired by Laravel Telescope
95 lines (70 loc) • 2.4 kB
Markdown
in your `main.ts`. No need to import anything in your modules!
```typescript
// main.ts
import { NestFactory } from '@nestjs/common';
import { AppModule } from './app.module';
import { TelescopeModule } from 'nestjs-telescope';
async function bootstrap() {
const app = await NestFactory.create(AppModule);
// One line setup - that's it!
TelescopeModule.setup(app);
await app.listen(3000);
}
bootstrap();
```
```typescript
// app.module.ts - No changes needed!
import { Module } from '@nestjs/common';
import { AppController } from './app.controller';
import { AppService } from './app.service';
@Module({
imports: [], // No need to import TelescopeModule here
controllers: [AppController],
providers: [AppService],
})
export class AppModule {}
```
```typescript
// app.module.ts
import { Module } from '@nestjs/common';
import { TelescopeModule } from 'nestjs-telescope';
import { AppController } from './app.controller';
import { AppService } from './app.service';
@Module({
imports: [TelescopeModule], // Import the module
controllers: [AppController],
providers: [AppService],
})
export class AppModule {}
```
Once setup, visit: `http://localhost:3000/telescope`
Set environment variables:
```bash
TELESCOPE_AUTH_ENABLED=true
TELESCOPE_USER=admin
TELESCOPE_PASS=secret123
```
The module automatically detects production environments and serves assets correctly from:
- Docker containers
- npm packages
- Bundled distributions
- Serverless environments
- 🔍 **Real-time HTTP requests** with full details
- 🚨 **Exception tracking** with stack traces
- 📈 **Live statistics** and performance metrics
- 🎨 **Beautiful dark/light UI** that works on mobile
The enhanced path resolution now handles production deployments automatically. If you still see issues, check that the `public` folder is included in your build.
Use either Option 1 (standalone) OR Option 2 (module import), not both.
The module now sets proper MIME types and cache headers automatically.
Just call `TelescopeModule.setup(app)`