Files
explore/lib/next/getServerSideProps.ts
T
2023-01-17 14:08:06 -06:00

18 lines
377 B
TypeScript

import type { GetServerSideProps } from 'next';
export type Props = {
cookies: string;
referrer: string;
id?: string;
}
export const getServerSideProps: GetServerSideProps<Props> = async({ req, query }) => {
return {
props: {
cookies: req.headers.cookie || '',
referrer: req.headers.referer || '',
id: query.id?.toString() || '',
},
};
};