futen
TypeScript icon, indicating that this package has built-in type declarations

1.3.2 • Public • Published

☁️ Futen 風天 (Heavenly Wind)

A (very) lightweight web framework, using decorators, simplifying syntax

Get started with:

bun init

bun i futen
import Futen, { route } from 'futen';

@route('/')
class Index {
    public get() {
        return new Response('Hello, World!');
    }
}

const server = new Futen({
    Index
});

console.log(`Server is running at http://localhost:${server.instance.port}`);

Know how

route defines an HTTP/REST route class which reserves the following methods as "keywords":

  • get
  • head
  • post
  • put
  • delete
  • connect
  • options
  • trace
  • patch

ws, similarly to the route decorator, reserves WebSocket event "keywords", which are documented in the Bun websocket docs, directly referencing the following methods:

  • message
  • open
  • close
  • drain
  • ping
  • pong

To see how they could be used check out the examples


Contributors

🤝 Become a contributor!

Package Sidebar

Install

npm i futen

Weekly Downloads

12

Version

1.3.2

License

MIT

Unpacked Size

18.7 kB

Total Files

24

Last publish

Collaborators

  • biocla