@rjweb/runtime-bun
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

@rjweb/runtime-bun

RJWEB Icon

Bun Runtime using built-in features for rjweb-server.

🏠 Homepage 🔍 Documentation

Disclaimer

This Package is intended to be used in the backend. THIS PACKAGE WILL ONLY WORK WITH BUN.

  • ✔️ ESM
  • ✖️ CJS
  • ✔️ Typescript

Install

npm install @rjweb/runtime-bun
yarn add @rjweb/runtime-bun
pnpm add @rjweb/runtime-bun
bun install @rjweb/runtime-bun

Example Usage

Basic Server

import { Server } from "rjweb-server"
import { Runtime } from "@rjweb/runtime-bun"

const server = new Server(Runtime, {
  port: 8080 // https://server.rjweb.dev/types/ServerOptions
})

server.path('/', (path) => path
  .http('GET', '/', (http) => http
    .onRequest((ctr) => {
      return ctr.print('Hello World!')
    })
  )
)

server.start().then((port) => {
  console.log(`Server started on port ${port}!`)
})

view more

Author

👤 0x7d8 🌐 WebsiteGitHub

🤝 Contributing

Contributions, issues and feature requests are welcome! Feel free to check issues page.

Show your support

Give a ⭐️ if this project helps you!

📝 License

Copyright © 2024 0x7d8. This project is MIT licensed.

Package Sidebar

Install

npm i @rjweb/runtime-bun

Weekly Downloads

1

Version

1.0.1

License

MIT

Unpacked Size

146 kB

Total Files

8

Last publish

Collaborators

  • 0x4096