mirror of
https://github.com/swissmakers/swiss-datashare.git
synced 2026-04-23 10:07:30 +02:00
16 lines
499 B
TypeScript
16 lines
499 B
TypeScript
|
|
import type { NextApiRequest, NextApiResponse } from "next";
|
||
|
|
|
||
|
|
const handler = async (req: NextApiRequest, res: NextApiResponse) => {
|
||
|
|
let publicEnvironmentVariables: any = {};
|
||
|
|
Object.entries(process.env).forEach(([key, value]) => {
|
||
|
|
if (key.startsWith("PUBLIC")) {
|
||
|
|
key = key.replace("PUBLIC_", "");
|
||
|
|
publicEnvironmentVariables[key] = value;
|
||
|
|
}
|
||
|
|
});
|
||
|
|
res.setHeader("cache-control", "max-age=100");
|
||
|
|
res.status(200).json(publicEnvironmentVariables);
|
||
|
|
};
|
||
|
|
|
||
|
|
export default handler;
|