mirror of
https://github.com/cloudflare/wrangler-action.git
synced 2024-11-27 04:04:46 +01:00
aa5d18dd1e
This reverts commit 2d275a8f2d
.
20 lines
385 B
TypeScript
20 lines
385 B
TypeScript
type Env = {
|
|
SECRET1?: string;
|
|
SECRET2?: string;
|
|
};
|
|
|
|
export default {
|
|
fetch(request: Request, env: Env) {
|
|
const url = new URL(request.url);
|
|
|
|
if (url.pathname === "/secret") {
|
|
const { SECRET1 = "", SECRET2 = "" } = env;
|
|
return new Response(`${SECRET1} ${SECRET2}`);
|
|
}
|
|
|
|
return Response.json({
|
|
...request,
|
|
headers: Object.fromEntries(request.headers),
|
|
});
|
|
},
|
|
};
|