Files
Sebastian "Sebbie" SilbermannandGitHub 3825ea5664 [test] Add case for import conditions in Pages Router API routes (#81036)
Case was absent from the react-server condition test suite but relevant to double check for an upcoming refactor
2025-06-30 11:37:50 +02:00

20 lines
605 B
TypeScript

import type { NextApiRequest, NextApiResponse } from 'next'
import * as react from 'library-with-exports/react'
import * as serverFavoringBrowser from 'library-with-exports/server-favoring-browser'
import * as serverFavoringEdge from 'library-with-exports/server-favoring-edge'
export const config = {
runtime: 'nodejs',
}
export default function handler(
request: NextApiRequest,
response: NextApiResponse
) {
return response.status(200).json({
react: react.condition,
serverFavoringBrowser: serverFavoringBrowser.condition,
serverFavoringEdge: serverFavoringEdge.condition,
})
}