Skip to main content
Home

@murat/yelix@0.1.47
Built and signed on GitHub Actions

Yelix is a powerful web server library built specifically for Deno, leveraging the Hono framework in the background. Including built-in data validation, OpenAPI 3.1 support, and auto-generated backend documentation.

This package works with Deno
This package works with Deno
JSR Score
82%
Published
2 months ago (0.1.47)
function request
request(
app: Yelix,
path: string,
config: Config,
): Promise<YelixResponse>

Makes a request to the Yelix application and returns a typed response

Examples

Example 1

// Simple GET request
const response = await request(app, '/api/hello?name=world', {
  method: 'GET'
});

// Assertions in tests
expect(response.req.status).toBe(200);
expect(response.res.responseType).toBe(ResponseType.TEXT);
expect(response.res.text).toBe('Hello, world');

// POST request with body
const response = await request(app, '/api/users', {
  method: 'POST',
  body: JSON.stringify({ name: 'John' }),
  headers: {
    'Content-Type': 'application/json'
  }
});

Parameters

app: Yelix

The Yelix application instance

path: string

The endpoint path to request

config: Config

Request configuration including method and other fetch options

Return Type

Promise resolving to YelixResponse

Throws

Error

When the Yelix app is not initialized

Error

When no response is received from the server

New Ticket: Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@murat/yelix

Import symbol

import { request } from "@murat/yelix";
or

Import directly with a jsr specifier

import { request } from "jsr:@murat/yelix";