fusion-framework
v1.2.3
Published
Class-based HTTP framework for Node.js, powered by a shared Rust core via N-API
Maintainers
Readme
Fusion Framework (Node.js)
Class-based HTTP APIs on a shared Rust core (fusion-core).
Handlers use this.params / this.query / this.body / this.state (no signature param injection — that is Python-only).
Install
npm i fusion-frameworkFrom this repo:
cd crates/fusion-node && npm install && npm run build:debugScaffold with Fusion Tool:
fusion init --lang typescript --name my-appQuick start
import { FusionBaseApi, route, status, FusionApp, getSettings, settings } from 'fusion-framework'
export const ItemModule = route('/api/[module]/{id}')(
class ItemModule extends FusionBaseApi {
get() {
return this.response({ id: this.params.id }, status.HTTP_SUCCESS)
}
},
)
const MIDDLEWARE = [] // your middleware; Fusion already adds frameworkHeaders() by default
settings.ensureLoaded()
const app = new FusionApp(getSettings())
for (const mw of MIDDLEWARE) app.use(mw)
await app.listen()Docs
Full guides (router, config, middleware):
https://fusion.cipherunit.xyz/en/docs/typescript/v1
- Site: fusion.cipherunit.xyz
- GitHub: cipherunits/fusion-framework
License
BSD 3-Clause
