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}`);
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
- Read the contributing guidelines
- Fork it!
- Do stuff...
- Submit a pull request!