1
0
Fork 0
mirror of https://github.com/kou029w/_.git synced 2025-01-30 22:08:02 +00:00

動的ルーティングのテスト

This commit is contained in:
Nebel 2019-07-09 17:11:41 +09:00
parent 3eeb6ee766
commit 5b71359f13
2 changed files with 12 additions and 0 deletions

View file

@ -0,0 +1,3 @@
import { Handler } from "express";
export const handler: Handler = (req, res) => res.json(req.query);
export default handler;

9
pages/query/[path].mdx Normal file
View file

@ -0,0 +1,9 @@
import { useRouter } from "next/router";
export const Query = () => {
const { query } = useRouter();
return <pre>{JSON.stringify(query, null, " ")}</pre>;
};
# Query
<Query />