Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/elysiajs/elysia-static
Plugin for Elysia for serving static folder
https://github.com/elysiajs/elysia-static
Last synced: 11 days ago
JSON representation
Plugin for Elysia for serving static folder
- Host: GitHub
- URL: https://github.com/elysiajs/elysia-static
- Owner: elysiajs
- License: mit
- Created: 2022-12-04T13:23:21.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-24T12:22:19.000Z (8 months ago)
- Last Synced: 2024-04-24T16:01:27.903Z (8 months ago)
- Language: TypeScript
- Size: 316 KB
- Stars: 9
- Watchers: 1
- Forks: 12
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
- awesome-elysia - static - Plugin for serving static folder. (Plugins)
README
# @elysiajs/static
Plugin for [elysia](https://github.com/saltyaom/elysia) for serving static folder.## Installation
```bash
bun add @elysiajs/static
```## Example
```typescript
import { Elysia } from 'elysia'
import { staticPlugin } from '@elysiajs/static'const app = new Elysia()
.use(staticPlugin())
.listen(8080)
```## Config
Below is an available config for a static plugin.### assets
@default "public"Asset path to expose as a public path
### prefix
@default '/public'Path prefix to create a virtual mount path for the static directory
### staticLimit
@defualt 1024If total files exceed this number, the file will be handled via wildcard instead of the static route to reduce memory usage
### alwaysStatic
@default booleanIf set to true, the file will always use a static path instead