@kingworldjs/static
TypeScript icon, indicating that this package has built-in type declarations

0.0.0-experimental.2 • Public • Published

@kingworldjs/static

Plugin for kingworld for serving static folder.

Installation

bun add @kingworldjs/static

Example

import { KingWorld } from 'kingworld'
import { staticPlugin } from '@kingworldjs/static'

const app = new KingWorld()
    .use(staticPlugin)
    .listen(8080)

Config

Below is an available config for a static plugin.

path

@default "public"

Path to expose as a public path

prefix

@default '/public'

Path prefix to create a virtual mount path for the static directory

staticLimit

@defualt 1024

If total files exceed this number, the file will be handled via wildcard instead of the static route to reduce memory usage

alwaysStatic

@default boolean

If set to true, the file will always use a static path instead

Readme

Keywords

Package Sidebar

Install

npm i @kingworldjs/static

Weekly Downloads

1

Version

0.0.0-experimental.2

License

MIT

Unpacked Size

25.4 kB

Total Files

11

Last publish

Collaborators

  • aomkirby123