Skip to content

Commit

Permalink
provide an example for withAxiomGetServerSideProps
Browse files Browse the repository at this point in the history
  • Loading branch information
schehata committed Jan 26, 2023
1 parent 9814d8a commit 181dc72
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions examples/logger/pages/serverSideProps.tsx
@@ -0,0 +1,18 @@
import { withAxiomGetServerSideProps } from 'next-axiom';

export const getServerSideProps = withAxiomGetServerSideProps(async ({ req, log }) => {
log.info('Hello from server side');
return {
props: {
method: req.method,
},
};
});

export default function Home({ method }: { method: string }) {
return (
<div>
<h1>Hello from server, this is a {method} request</h1>
</div>
);
}

0 comments on commit 181dc72

Please sign in to comment.