urgot
TypeScript icon, indicating that this package has built-in type declarations

1.3.52 • Public • Published

installation

npm i urgot

Hello World

import { Server } from 'urgot'

const server = new Server()
server.use(async (context, next) => {
  context.body = 'Hello World'
  await next()
})
server.listen(5611)

Register middleware

server.use(async (context, next) => {
  const start = Date.now()
  await next()
  const ms = Date.now() - start
  context.setHeader('X-Response-Time', `${ms}ms`)
  context.body = 'Hello World'
})

Call next to execute after other middleware executes

npx urgot dev

Readme

Keywords

Package Sidebar

Install

npm i urgot

Weekly Downloads

3

Version

1.3.52

License

MIT

Unpacked Size

28.5 kB

Total Files

15

Last publish

Collaborators

  • apprat