@zarfjs/adapter-node
TypeScript icon, indicating that this package has built-in type declarations

0.0.8 • Public • Published

@zarfjs/adapter-node

Node.js adapter for Zarf. Provide a Zarf app, and let this adapter adapt the incoming requests and outgoing responses into a format Node.js understands.

Note: It works, but it's yet to be fully tested for compatibility issues

Usage


import { Zarf } from '@zarfjs/zarf'
import { createServer } from '@zarfjs/adapter-node'

const app = new Zarf()

app.get("/hello/:user", (ctx, params) => {
    return ctx.json({
        hello: params.user
    })
})

const server = createServer(app).listen({
    port: 3000
}, (server) => {
    console.log(`Server started on 3000`)
})

Author


Aftab Alam https://github.com/one-aalam

License


Distributed under the MIT License. See LICENSE for more information.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.8
    1
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.0.8
    1
  • 0.0.7
    0
  • 0.0.6
    0
  • 0.0.2
    0

Package Sidebar

Install

npm i @zarfjs/adapter-node

Weekly Downloads

1

Version

0.0.8

License

MIT

Unpacked Size

11.4 kB

Total Files

6

Last publish

Collaborators

  • one-aalam