I just posted this to stack here and really seekng help with node.jsI'm primarily a front end developer and I am having trouble understanding how to pass multiple parameters/values into the Easy Post API in my controller (node.js).I was able to get the starter code working to pass a single tracking number and carrier code, but now I am stuck with trying to pass multiple paramters/values.Any help / direction would be greatly appreciated.app.get("/api/tracking/retrieve", (req, res) => {const apiKey = 'My_API_Key';const Easypost = require('@easypost/api');const api = new Easypost(apiKey);tracking = ['EZ6000000006', 'EZ6000000006'];carrier = ['UPS', 'UPS'];const tracker = new api.Tracker({tracking_code: tracking,carrier: carrier });tracker.save().then(console.log);})}
Submitted March 17, 2019 at 12:45AM by ellisandwhispa
No comments:
Post a Comment