rsnext/examples/with-axiom/middleware.ts
Islam Shehata 9d30ef15e1
adding with-axiom example (#38300)
## Documentation / Examples

- [ X ] Make sure the linting passes by running `pnpm lint`
- [ X ] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)


This PR adds an example for using next.js with axiom.

Co-authored-by: Balázs Orbán <info@balazsorban.com>
Co-authored-by: Steven Tey <stevensteel97@gmail.com>
2022-09-01 09:50:03 -05:00

9 lines
239 B
TypeScript

import { NextResponse } from 'next/server'
import { log, withAxiom } from 'next-axiom'
async function middleware() {
log.info('Hello from middleware', { bar: 'baz' })
return NextResponse.next()
}
export default withAxiom(middleware)