1.1.1 • Published 1 year ago

@rjweb/runtime-node v1.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

@rjweb/runtime-node

Node Runtime using http library for rjweb-server.

šŸ  Homepage šŸ” Documentation

Disclaimer

This Package is intended to be used in the backend. DO NOT USE THIS PACKAGE WITH BUN.

  • āœ”ļø ESM
  • āœ”ļø CJS
  • āœ”ļø Typescript

Install

npm install @rjweb/runtime-node
yarn add @rjweb/runtime-node
pnpm add @rjweb/runtime-node
bun install @rjweb/runtime-node # not recommended to run the code, installing is fine

Example Usage

Basic Server

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

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 🌐 Website ⭐ GitHub

šŸ¤ 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.

1.1.1

1 year ago

1.1.0

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago