@outray/nest
NestJS integration for Outray, the open-source tunneling solution. Automatically expose your local NestJS server to the internet during development.
Installation
npm install @outray/nest
pnpm add @outray/nest
yarn add @outray/nest
Usage
Import the outray function and call it in your main.ts file after your application starts listening.
import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import { outray } from '@outray/nest';
async function bootstrap() {
const app = await NestFactory.create(AppModule);
await app.listen(3000);
if (process.env.NODE_ENV !== 'production') {
await outray(app);
}
}
bootstrap();
Configuration
You can pass options to the outray function:
await outray(app, {
port: 3000,
subdomain: 'my-cool-app',
customDomain: 'api.example.com',
silent: false,
});
Options Reference
port | number | Auto-detected | The local port your NestJS app is running on. |
subdomain | string | Random | Request a specific subdomain. |
apiKey | string | process.env.OUTRAY_API_KEY | Your Outray API key. |
enabled | boolean | true (in dev) | Whether to enable the tunnel. |
silent | boolean | false | specific to Console logs. |
onTunnelReady | (url: string) => void | - | Callback when tunnel is ready. |
License
MIT