I’m trying to build a Node.js (Express.js) microservice project with push notification subject, but I don’t want to use FCM, APN, One Signal or other push notification services. I want to use my own Socket.io to push notification to android/web users. There are some features : 1.Send notifications to specific user/users 2.Send notifications to users ..

Read more

Third console statement executes before the second one when i request to api to get response the other code start executing and i want to prevent this i’m new to javascript., i tryed async-await but i’m doing something wrong..! app.post(‘/api’, async (req, res) => { console.log(req.body.msg+" -> "+req.body.user+" -> one"); options.qs.message=req.body.msg; options.qs.uid=req.body.user; let botRespone= await ..

Read more

I have referred to this article, but not what I wanted. convert object keys and values to an array of objects I have the following data: var test = { apple1:"a", apple2: "b", apple3: "c", v1r:’1′, v2r:’2′, v3r:’3′, v4r:’4′, a1:’5′ } My attempts: var keys = Object.keys(test); var result = keys.reduce((cur,item)=>{ if(/^d+$/.test(item)){ let obj = ..

Read more

How to remove sorting from this script part: getFirstAvailablePeriod() { const sortedPeriods = this.periods.sort((a: IPeriod, b: IPeriod) => { if (a.default_price.price === b.default_price.price) { return 0; } return (a.default_price.price > b.default_price.price) ? 1 : -1; }).filter((period: IPeriod) => !period.locked); const alreadySelected: IPeriod = sortedPeriods.find((period: IPeriod) => period.id === this.value); if (alreadySelected) { return alreadySelected; } ..

Read more

I have located a point on a map var layer = new ol.layer.Vector({ source: new ol.source.Vector({ features: [ new ol.Feature({ geometry: new ol.geom.Point(ol.proj.fromLonLat(cord)), label: ‘Label’ }) ] }), style: (feature) => { myStyle.getText().setText(feature.get(‘label’)); return [myStyle]; } }); I just wanted to make a link to the label (or the point) that takes me to another ..

Read more