forked from greenpill-dev-guild/camp-green
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updated vercel functions to javascript code
updated install instructions for different platforms
- Loading branch information
Showing
6 changed files
with
92 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
export default async function handler(req, res) { | ||
if (req.method === "POST") { | ||
const { email } = req.body; | ||
|
||
const mailchimpUrl = `https://app.us13.list-manage.com/subscribe/post?u=16db3a1a92dd56e81459cd500&id=c6c12d1a3f&f_id=0021fae1f0`; | ||
|
||
const data = new URLSearchParams(); | ||
data.append("EMAIL", email); | ||
data.append("b_16db3a1a92dd56e81459cd500_c6c12d1a3f", ""); // hidden input to prevent bot signups | ||
|
||
try { | ||
const response = await fetch(mailchimpUrl, { | ||
method: "POST", | ||
headers: { | ||
"Content-Type": "application/x-www-form-urlencoded", | ||
}, | ||
body: data.toString(), | ||
}); | ||
|
||
if (response.ok) { | ||
res | ||
.status(200) | ||
.json({ success: true, message: "Subscription successful!" }); | ||
} else { | ||
res | ||
.status(response.status) | ||
.json({ success: false, message: "Subscription failed." }); | ||
} | ||
} catch (error) { | ||
res | ||
.status(500) | ||
.json({ success: false, message: "Internal Server Error" }); | ||
} | ||
} else { | ||
res.setHeader("Allow", ["POST"]); | ||
res.status(405).end(`Method ${req.method} Not Allowed`); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
const { PrivyClient } = require("@privy-io/server-auth"); | ||
// import type { VercelRequest, VercelResponse } from "@vercel/node"; | ||
|
||
// declare global { | ||
// namespace NodeJS { | ||
// interface ProcessEnv { | ||
// VITE_PRIVY_APP_ID?: string; | ||
// PINATA_API_KEY?: string; | ||
// PINATA_API_SECRET?: string; | ||
// PRIVY_APP_SECRET_ID?: string; | ||
// } | ||
// } | ||
// } | ||
|
||
export const config = { | ||
// runtime: "nodejs", | ||
}; | ||
|
||
const privy = new PrivyClient( | ||
process.env.VITE_PRIVY_APP_ID, | ||
process.env.PRIVY_APP_SECRET_ID | ||
); | ||
|
||
export default async function handler(_request, response) { | ||
const users = await privy.getUsers(); | ||
|
||
response.status(200).json(users); | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26f9e30
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
green-goods – ./
green-goods-git-main-greenpill-dev-guild.vercel.app
green-goods-greenpill-dev-guild.vercel.app
greengoods.app
www.greengoods.app