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
let arc = require("@architect/functions"); | |
let parseBody = arc.http.helpers.bodyParser; | |
const data = require("@begin/data"); | |
exports.handler = async function http(req) { | |
let body = parseBody(req); | |
let cart = body.cart; | |
// cart is of the form: { cc1: 1, cc2: 2, cc3: 3, cc4: 4, cc5: 5 } |
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
addEventListener('fetch', event => { | |
event.respondWith(handleRequest(event.request)) | |
}) | |
const countries = { | |
US: "USA", | |
CA: "CAN", | |
FR: "FRA", | |
DE: "DEU", | |
NL: "NLD", |