tldraw/apps/www/pages/r/index.tsx
Steve Ruiz c3050db968
[fix] copy and paste (again) (#685)
* fix copy

* remove console logs

* update types
2022-05-14 14:15:55 +01:00

27 lines
566 B
TypeScript

import * as React from 'react'
import type { GetServerSideProps } from 'next'
import Head from 'next/head'
export default function RandomRoomPage() {
return (
<>
<Head>
<title>tldraw</title>
</Head>
</>
)
}
export const getServerSideProps: GetServerSideProps = async (context) => {
// Generate random id
const id = Date.now().toString()
// Route to a room with that id
context.res.setHeader('Location', `/r/${id}`)
context.res.statusCode = 307
// Return id (though it shouldn't matter)
return {
props: {},
}
}