Skip to content

Instantly share code, notes, and snippets.

View sm-a's full-sized avatar

Sven M. Auer sm-a

  • 05:58 (UTC +01:00)
View GitHub Profile
router.get('/brand/:smabrand', function(req, res) {
const smaquery = req.query;
// [..]
let getProductCount=async function(smaquery){
let count= await Products.countDocuments(smaquery);
console.log(count)
if (count === 0) {
return res.send("Brand not found!");
try {
axios.get("here-my-url")
.then(data => res.status(200).send(data))
.catch(err => res.send(err));
} catch(err) {
console.error("ERROR", err);
}
const axios = require("axios");
axios.request({
url: "/identity/v1/oauth2/token",
method: "POST",
baseURL: "https://api.sandbox.ebay.com/",
auth: {
username: "", // eBay client id
password: "" // eBay client secret
},
[...]
docx.init({
ND_DEV_ID: "", // goto https://developers.nativedocuments.com/ to get a dev-id/dev-secret
ND_DEV_SECRET: "", // you can also set the credentials in the enviroment variables
ENVIRONMENT: "NODE", // required
LAZY_INIT: true // if set to false the WASM engine will be initialized right now, usefull pre-caching (like e.g. for AWS lambda)
}).catch(function (e) {
console.error(e);
});
Cats.find({ user: req.params.user }, function (err, product) {
if (err) {
return res.send({ isFound: false });
}
if (!product) {
return res.send({ isFound: false });
}
product.forEach(element => {
element.orderid = req.params.smaorderid
Carts.find({ user: req.params.user }, function (err, product) {
if (err) {
return res.send({ isFound: false });
}
if (!product) {
return res.send({ isFound: false });
}
product.forEach(element => {
element.orderid = req.params.smaorderid