Skip to content

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

License

Notifications You must be signed in to change notification settings

DotEnv-it/futen

Repository files navigation

☁️ Futen 風天

A lightweight web api framework

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!