Skip to content

Commit

Permalink
3
Browse files Browse the repository at this point in the history
  • Loading branch information
futurGH committed Dec 21, 2023
1 parent d782765 commit f062cc1
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/routes/api/contact.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ import type { HydrogenRequest } from "@shopify/hydrogen";

const env: Record<string, string> = typeof Oxygen !== "undefined" && "env" in Oxygen ? Oxygen.env : import.meta.env;

console.log({
accessKeyId: env.SES_ACCESS_KEY_ID,
secretAccessKey: env.SES_ACCESS_KEY,
});
const client = new SESClient({
credentials: {
accessKeyId: env.SES_ACCESS_KEY_ID,
Expand All @@ -17,6 +13,12 @@ const client = new SESClient({

export async function api(request: HydrogenRequest) {
console.log(request);
console.log(
JSON.stringify({
accessKeyId: env.SES_ACCESS_KEY_ID,
secretAccessKey: env.SES_ACCESS_KEY,
}),
);
if (request.method === "GET") return new Response(null, { status: 302, headers: { Location: "/contact-us" } });
if (request.method !== "POST") return new Response(null, { status: 405 });

Expand Down

0 comments on commit f062cc1

Please sign in to comment.