@tunframework/tun
v2.0.7
Published
tun framework for node with typescript
Downloads
30
Maintainers
Readme
tun
tun framework for node with typescript
install
npm install @tunframework/tun
example
import { TunApplication } from '@tunframework/tun'
const app = new TunApplication()
app.use(async (ctx, next) => {
return `Hi, world!`
})
const server = app.listen({ host: '127.0.0.1', port: 0 })
server.on('listening', async () => {
// @type {AddressInfo}
let addr = server.address() || {}
console.log(`listening: http://${addr.address}:${addr.port}`)
})