mirror of
https://github.com/kou029w/_.git
synced 2025-01-31 06:18:07 +00:00
動的ルーティングのテスト
This commit is contained in:
parent
3eeb6ee766
commit
5b71359f13
2 changed files with 12 additions and 0 deletions
3
pages/api/query/[path].ts
Normal file
3
pages/api/query/[path].ts
Normal 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
9
pages/query/[path].mdx
Normal 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 />
|
Loading…
Add table
Reference in a new issue