Skip to main content

@std/http@1.0.8
Built and signed on GitHub Actions

Utilities for building HTTP servers

This package works with DenoIt is unknown whether this package works with Bun
This package works with Deno
It is unknown whether this package works with Bun
JSR Score
94%
Published
19 hours ago (1.0.8)

Contains functions serveDir and serveFile for building a static file server.

This module can also be used as a CLI. If you want to run it directly:

> # start server
> deno run --allow-net --allow-read --allow-sys jsr:@std/http/file-server
> # show help
> deno run jsr:@std/http/file-server --help

If you want to install and run:

> # install
> deno install --allow-net --allow-read --allow-sys --global jsr:@std/http/file-server
> # start server
> file-server
> # show help
> file-server --help

Functions

f
serveDir

Serves the files under the given directory root (opts.fsRoot).

f
serveFile

Resolves a Response with the requested file as the body.

Interfaces

I
ServeDirOptions

Interface for serveDir options.

I

Add Package

deno add jsr:@std/http

Import symbol

import * as mod from "@std/http/file-server";

---- OR ----

Import directly with a jsr specifier

import * as mod from "jsr:@std/http/file-server";

Add Package

bunx jsr add @std/http

Import symbol

import * as mod from "@std/http/file-server";