Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/fastro/http/server/types.ts>Context

Full Stack Framework for Deno, TypeScript, Preact JS and Tailwind CSS
Go to Latest
class Context
import { Context } from "https://deno.land/x/fastro@v0.85.1/http/server/types.ts";

Define the information for a HTTP request, render, send & options

Index Signatures

[key: string]: any

Properties

Information for a HTTP request.

Deno KV Instance defined in Fastro Constructor

next: Next

Middleware callback

options: Record<string, any>

Server options defined in Fastro Constuctor

render: <T>(data?: T | undefined) => Response | Promise<Response>

Render a JSX Component or a Page with data

  • If you call it from a standart handler (GET, POST, PUT, DELETE), it will render a JSX component.
  • If you call it from a page handler, it will render the data using the predefined JSX layout.
send: <T>(data?: T | undefined, status?: number | undefined) => Response | Promise<Response>

Send data to client

server: Fastro

Instance of server

url: URL

The URL interface represents an object providing static methods used for creating object URLs.