2.0.7 • Published 2 years ago
@tunframework/tun v2.0.7
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}`)
})