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

x/lume/core.ts>Server

🔥 Static site generator for Deno 🦕
Very Popular
Go to Latest
class Server
Re-export
import { Server } from "https://deno.land/x/lume@v1.15.3/core.ts";

Constructors

new
Server(options: Options)

Properties

events: Events<ServerEvent>
middlewares: Middleware[]
options: Options

Methods

addEventListener(
type: ServerEventType,
listener: EventListener<ServerEvent>,
options?: EventOptions,
)

Add a listener to an event

dispatchEvent(event: ServerEvent)

Dispatch an event

handle(request: Request, connInfo: ConnInfo): Promise<Response>

Handle a http request event

serveFile(request: Request): Promise<Response>

Server a static file

Start the server

Stops the server

use(...middleware: Middleware[])

Register one or more middlewares