forked from vercel/commerce
-
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.
Merge pull request vercel#46 from DSCO-Co/callamsBranch
Callams branch
- Loading branch information
Showing
8 changed files
with
73 additions
and
5 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
// import axios from 'axios' | ||
|
||
// // localhost:3000/api/webhooks/stape | ||
|
||
// /* | ||
// nextjs client -> api route -> stape.io -> gtm | ||
// client: POST /api/webhooks/stape | ||
// server: builds the event type, adds user data, adds product data, etc... | ||
// server: POST https://ss.poochie.co/collect, whatever... | ||
// */ | ||
// export default async function handler(req, res) { | ||
// const requestMethod = req.method | ||
|
||
// switch (requestMethod) { | ||
// case 'GET': | ||
// res.status(200).json({ | ||
// message: `Get requests are not supported. Did you mean to make a POST request?`, | ||
// }) | ||
// break | ||
|
||
// case 'POST': | ||
// const eventData = req.body | ||
// console.log('Received event data:', eventData) | ||
|
||
// const url = eventData.url ? encodeURIComponent(eventData.url) : '' | ||
|
||
// try { | ||
// const response = await axios.get( | ||
// `https://ss.poochie.co/g/collect?v=2&en=page_view&tid=G-1234&cid=123.456&dl=${url}`, | ||
// { | ||
// headers: { | ||
// 'x-gtm-server-preview': | ||
// 'ZW52LTR8Mm1kZnBEQ1ZpdHhJemRkbkNEaU9zd3wxODc3YzgzOTNhMTFhMzVjNmNmZDQ=', | ||
// }, | ||
// } | ||
// ) | ||
// console.log('Axios response:', response.data) | ||
// } catch (error) { | ||
// console.error('Axios request failed:', error) | ||
// } | ||
|
||
// res | ||
// .status(200) | ||
// .json({ message: 'Hey it worked in stape routes this time' }) | ||
// break | ||
|
||
// // handle other HTTP methods | ||
// default: | ||
// res.status(200).json({ message: 'Welcome to API Routes!' }) | ||
// break | ||
// } | ||
// } | ||
export {} |
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
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.