<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>funnelbit</author_name>
  <author_url>https://blog.hatena.ne.jp/funnelbit/</author_url>
  <blog_title>┗┐＜(՞ਊ՞)＞┌┛</blog_title>
  <blog_url>https://funnelbit.hatenablog.com/</blog_url>
  <categories>
  </categories>
  <description>Next.js の API Routes に書かれた実装をテストしたいときを考えたい(jest)。 まずは簡単な api を作ってみる。クエリパラメータ animal=dog をつけて/api/check?animal=dog としてアクセスすると /dog にリダイレクトし、逆にクエリパラメータ animal=dog 無しでアクセスすると 400 が返ってくる API を作ってみる。 import { NextApiRequest, NextApiResponse } from &quot;next&quot;; // pages/api/check.api.ts export default async ( …</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Ffunnelbit.hatenablog.com%2Fentry%2F2020%2F12%2F17%2F180709&quot; title=&quot;Next.js の API Routes に書かれた実装のテスト - ┗┐＜(՞ਊ՞)＞┌┛&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2020-12-17 18:07:09</published>
  <title>Next.js の API Routes に書かれた実装のテスト</title>
  <type>rich</type>
  <url>https://funnelbit.hatenablog.com/entry/2020/12/17/180709</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
