From a570d155bafc533d4da04ed3a80043da35eed0ac Mon Sep 17 00:00:00 2001 From: cupcakearmy Date: Wed, 15 Jan 2020 18:12:04 +0100 Subject: [PATCH] test env --- pages/api/env.tsx | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 pages/api/env.tsx diff --git a/pages/api/env.tsx b/pages/api/env.tsx new file mode 100644 index 0000000..66a7997 --- /dev/null +++ b/pages/api/env.tsx @@ -0,0 +1,15 @@ +import { NextApiRequest, NextApiResponse } from 'next' +import getConfig from 'next/config' + +const config = getConfig().serverRuntimeConfig + + +export default async (req: NextApiRequest, res: NextApiResponse) => { + try { + res.send(JSON.stringify(config)) + res.status(200).end() + + } catch { + res.status(400).end() + } +} \ No newline at end of file