feat: add share url alias /s
This commit is contained in:
18
frontend/src/pages/s/[shareId].ts
Normal file
18
frontend/src/pages/s/[shareId].ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { GetServerSidePropsContext } from "next";
|
||||
|
||||
// Redirect to the share page
|
||||
export function getServerSideProps(context: GetServerSidePropsContext) {
|
||||
const { shareId } = context.params!;
|
||||
|
||||
return {
|
||||
props: {},
|
||||
redirect: {
|
||||
permanent: false,
|
||||
destination: "/share/" + shareId,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
export default function ShareAlias() {
|
||||
return null;
|
||||
}
|
||||
Reference in New Issue
Block a user