open-index/open-npm huggingface dataset:
npm package: @outray/express
Description: Express middleware to automatically expose your dev server via Outray tunnel
Author: akinloluwami
Latest version: 0.0.2

# @outray/express

Express middleware to automatically expose your development server to the internet via [Outray](https://outray.dev) tunnel.

## Installation

```bash
npm install @outray/express
```

## Usage

### Basic Usage

```typescript
import express from 'express'
import outray from '@outray/express'

const app = express()

// Apply Outray middleware
outray(app)

app.get('/', (req, res) => {
  res.send('Hello World!')
})

app.listen(3000, () => {
  console.log('Server running on port 3000')
})
```

When you start your server in development mode, you'll see:

```
Server running on port 3000
  ➜  Tunnel:  https://quick-tiger.outray.app
```

### With Options

```typescript
import express from 'express'
import outray from '@outray/express'

const app = express()

outray(app, {
  subdomain: 'my-app',
  apiKey: process.env.OUTRAY_API_KEY,
  onTunnelReady: (url) => {
    console.log('Tunnel ready at:', url)
  }
})

app.listen(3000)
```

## Options

```typescript
interface OutrayPluginOptions {
  /** Subdomain to use (requires authentication) */
  subdomain?: string;
  
  /** Custom domain (must be configured in dashboard) */
  customDomain?: string;
  
  /** API key for authentication */
  apiKey?: string;
  
  /** Outray server URL */
  serverUrl?: string;
  
  /** Enable/disable tunnel (default: true in development) */
  enabled?: boolean;
  
  /** Suppress logs */
  silent?: boolean;
  
  /** Callback when tunnel is ready */
  onTunnelReady?: (url: string) => void;
  
  /** Callback on error */
  onError?: (error: Error) => void;
  
  /** Callback on reconnecting */
  onReconnecting?: () => void;
  
  /** Callback on close */
  onClose?: () => void;
}
```

## Environment Variables

- `OUTRAY_API_KEY` - Your Outray API key
- `OUTRAY_SUBDOMAIN` - Custom subdomain
- `OUTRAY_ENABLED` - Set to `"false"` to disable
- `OUTRAY_SERVER_URL` - Custom server URL (default: `wss://api.outray.dev/`)
npm package: @outray/nest
Description: NestJS plugin to automatically expose your dev server via Outray tunnel
Latest version: 0.0.2

# @outray/nest

NestJS integration for [Outray](https://outray.dev), the open-source tunneling solution. Automatically expose your local NestJS server to the internet during development.

## Installation

```bash
npm install @outray/nest
# or
pnpm add @outray/nest
# or
yarn add @outray/nest
```

## Usage

Import the `outray` function and call it in your `main.ts` file after your application starts listening.

```typescript
import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import { outray } from '@outray/nest';

async function bootstrap() {
  const app = await NestFactory.create(AppModule);
  
  // Start the server
  await app.listen(3000);

  // Start the tunnel in development
  if (process.env.NODE_ENV !== 'production') {
    await outray(app);
  }
}
bootstrap();
```

## Configuration

You can pass options to the `outray` function:

```typescript
await outray(app, {
  // Optional: Explicitly specify port (auto-detected otherwise)
  port: 3000,
  
  // Optional: Request a specific subdomain
  subdomain: 'my-cool-app',
  
  // Optional: Use a custom domain
  customDomain: 'api.example.com',
  
  // Optional: Suppress console output
  silent: false,
});
```

### Options Reference

| Option | Type | Default | Description |
|--------|------|---------|-------------|
| `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