From 5b71359f13dc018155d5e9a6a0c17d906e584929 Mon Sep 17 00:00:00 2001 From: Kohei Watanabe Date: Tue, 9 Jul 2019 17:11:41 +0900 Subject: [PATCH] =?UTF-8?q?=E5=8B=95=E7=9A=84=E3=83=AB=E3=83=BC=E3=83=86?= =?UTF-8?q?=E3=82=A3=E3=83=B3=E3=82=B0=E3=81=AE=E3=83=86=E3=82=B9=E3=83=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/api/query/[path].ts | 3 +++ pages/query/[path].mdx | 9 +++++++++ 2 files changed, 12 insertions(+) create mode 100644 pages/api/query/[path].ts create mode 100644 pages/query/[path].mdx diff --git a/pages/api/query/[path].ts b/pages/api/query/[path].ts new file mode 100644 index 0000000..40919e9 --- /dev/null +++ b/pages/api/query/[path].ts @@ -0,0 +1,3 @@ +import { Handler } from "express"; +export const handler: Handler = (req, res) => res.json(req.query); +export default handler; diff --git a/pages/query/[path].mdx b/pages/query/[path].mdx new file mode 100644 index 0000000..b75807c --- /dev/null +++ b/pages/query/[path].mdx @@ -0,0 +1,9 @@ +import { useRouter } from "next/router"; +export const Query = () => { + const { query } = useRouter(); + return
{JSON.stringify(query, null, "  ")}
; +}; + +# Query + +