Tagged Questions
Node.js is an event-based, non-blocking, asynchronous I/O framework that uses Google's V8 JavaScript engine and libuv library. It is used for developing applications that make heavy use of the ability to run JavaScript both on the client, as well as on server side and therefore benefit from the re-...
0
votes
0answers
5 views
Why do we call tech'stack'?
People introduce the technologies used in developing an application as techstack. Is it because technologies will depend one on another forming a stack like structure? If yes, is it applicable to ...
0
votes
0answers
3 views
CloudantDB: using db.get without id
I have a table:
id: 001
name: test
provider_id:ABC123
and I try to query with provider_id and get a error message, but not with id:001
db.get("ABC123", function(err, data) {
// The rest of your ...
-2
votes
0answers
8 views
how do asp.net, nodejs, iis, web server, angular2, web application and npm relate with each other?
asp.net, nodejs, iis, web server, angular2, web application and npm. Can we use all these in single project? and how do they relate to each other?
0
votes
0answers
4 views
ENOENT with gulp watch on Chopstick boilerplate
Environment
I'm using NodeJS v6.9.1 and NPM v4.0.2 on Windows 10
Included are my gulpfile.js, bower.json and package.json. The boilerplate I'm using is called Chopstick.
Question
What could be the ...
0
votes
0answers
3 views
Returning a specific number of Items on dynamoDB
I'm trying to make a program witch return only the amount of Items specified by the user:
"Quantity": "all" --> it makes a full scan of the database and return all the Items on it.
"Quantity": n --> ...
0
votes
0answers
4 views
Loopback context returning null in afterhook method
I am newbie to loopback, I have written a function for signup and
executing on beforeRemote. Here I can able to access loopback context. But after user created I am executing another function to send ...
0
votes
0answers
6 views
Sort 2 times mongoose
I have query like this:
.find({conversationId: conversation})
.sort({'createDate': -1})
.skip(perPage * page)
.limit(perPage)
It will return 5 last ...
1
vote
1answer
23 views
insertMany is not a function
For my project I am making a system that lets users create and configure their own soccer tournaments. After a tournament is made I have to put poules and teams into the tournament document in mongo. ...
0
votes
0answers
3 views
How to connect Node Sequelize to Amazon RDS MySQL with Multi-AZ probably
I'm using an Amazon RDS hosted MySQL with Multi-AZ Support. Just could not find any information on how to connect Sequelize to Amazon RDS probably so that Sequelize is handling fail-overs etc. ...
0
votes
2answers
11 views
Updating mongodb with angularjs and node
I nneed to update my mongodb. using nodejs and angularjs on the front end. I have the above code but i get `TypeError: Cannot read property 'put' of undefined
My angularjs controller :
myApp....
0
votes
0answers
9 views
Search in Alexa skill
I'm building Alexa skill that plays audios. An audio has a title, speakers and other properties.
Problem: I want to add search functionality in my skill, so that user may play audio on base of title ...
0
votes
0answers
6 views
How to get coordinates of pdf form fields in Node JS
Basically I am trying to add Signature at proper place in document.
To achieve this I have added textfield (having name: Signature) in document, so that if I get the coordinates of that field, then I ...
0
votes
0answers
6 views
How do I get by attribute value with xpath in node js
Given XML
<ValCredLookup>
<ValCredName name="val-cred-api-cust">
<certificate thumbprint="12345">
<clientID id="1bbfea">
<Merchant-id>123456789&...
0
votes
0answers
6 views
use node.js cluster with socket.io chat application
I'm trying to learn node.js cluster with socket.io to create a chat application... the problem is that I can't seem to get things working.
i've been trying to go through all the tutorials including ...
0
votes
0answers
6 views
Objection js model fields data trim before saving the record in postgres in nodejs
I am using objection.js ORM for my node.js project. Everything is good, I want to trim all the fields before actually saving the data in the PostGres database table. I have also used mongoose in some ...
0
votes
1answer
7 views
What's the equivalence of typings globalDevDependencies for npm @types packages?
I want to upgrade an [email protected] project to tsc@2 and in the process ditch typings from my tool chain.
It's not a problem for the common depencies as these dependencies from my typings.json:
"...
0
votes
1answer
15 views
Node. get data from database and and make post request with results [duplicate]
I have a list of users in a database. They have initially been given an access_token, when signing up to db, but as this expires I need to create a new access_token through a refresh_token which has ...
0
votes
1answer
19 views
I am trying to get a single array value from mongodb, but when i try i get the whole object
1.I Don't get the Item in Electro Array but the whole doc
getItem(data){
dbswap.findOne(
{ 'swap.Items.Electro.id':data.id,
'swap.Items.Electro.id':data.id }, function(err,...
0
votes
0answers
15 views
Best way to implement auto suggestions feature?
Currently, we are manually making a request call for suggestion data with every keyup, but cancelling the previous call made before making the new one. Is there a better way to do this with Angular.js/...
0
votes
1answer
5 views
Error: 421 Timeout waiting for data from client using express-mailer with attachments
I'm using express-mailer (which built on top of nodemailer) to send email from my nodejs app. If I send a plain html email, it works just fine, but if I try to attach files, I get Error: 421 Timeout ...
-1
votes
0answers
18 views
Getting Username in Facebook authentication from JavaScript
I tried several methods to get username from facebook authentication but I am not able to find solution.
I am working on a website with NodeJS and ReactJS. Please suggest me the best way to get ...
-2
votes
1answer
17 views
Node Callback from database query to express request
I want the function below (listServers()) to callback data to be used in the express request below. But I am confused by the set up of a callback as I have got conflicting information from searching.
...
0
votes
1answer
13 views
Detect TLS Version in Node Express App?
Is it possible to detect the TLS version 1.1 or 1.2 etc in Node Express application.
0
votes
2answers
15 views
send large json object as response is takes long time in express
I am using: node, express, routing-controllers
when i try to response large json object, it takes more than 60s.
there is my code :
@Get("/")
getAll() {
return db.get('phones')
}
if i response ...
0
votes
0answers
10 views
Force dependency to use specific sub dependency version
I am building my website code with webpack and npm modules and sutmbled upon the following problem:
My code uses jQuery 3.1.1 and adds some plugins to it.
I am also using a dependency that has a sub-...
1
vote
2answers
14 views
require is not defined in Firebase?
I am trying to run a html file in Firebase staging environment. I have used Firebase npm package in the js code. But while running in the browser it throws error "require is not defined".
HTML Code:
...
1
vote
0answers
8 views
combine bin and install script
Given the following excerpt from package.json:
{
"name": "foo",
"version": "0.0.1",
"description": "Foo",
"main": "bin/index.js",
"bin": "bin/index-cli.js",
"private": true,
"scripts": {...
1
vote
1answer
18 views
Fail to use babel with webpack
I want to write a simple demo by using webpack and babel, but I really cant figure out what problem is, I have webpack version 1.13.3 and after i try to install npm install --save-dev babel-core babel-...
0
votes
2answers
10 views
-bash: grunt: command not found - mac OSx
I'm a bit of a newbie.
Here is the information I can provide and I can provide further information is needed. I've documented everything i've done.
I'm a quick learner too.
I'm on MAC OSX El ...
0
votes
1answer
24 views
try/catch blocks with async/await
I'm digging into the node 7 async/await feature and keep stumbling across code like this
async function main() {
try {
var quote = await getQuote();
console.log(quote);
} catch(error) {
...
0
votes
0answers
22 views
exception not caught in promise in node
I've the following code in strict mode:
ajv
.validate(form, data)
.then((valid) => {
return Promise.resolve(data);
})
.then(createUser) //take userData as argument
....
0
votes
1answer
9 views
connect client to server using socket.io
I have a node.js basic server as follow:
app.js file:
var express = require('express');
config = require('./config/config');
var app = express();
require('./config/express')(app, config);
var ...
0
votes
2answers
21 views
what should be the response code for error in DB query
In my API if any query get err then what should be response status 400 / 500 or anything else
eg
Grade.find({},function(err,grades) {
if (err)
res.status(500).json({error:err,message: '...
0
votes
1answer
15 views
Making a CORS client-side request with Webpack - Node.JS [duplicate]
I'm using Webpack to bundle my javascript code and use modules in the browser.
I'm trying to get the body of a URL (http://www.redbubble.com); however, I get the following error:
XMLHttpRequest ...
0
votes
1answer
15 views
How to retry API calls when error returns?
I am making a code calling APIs using async.parallel
But sometimes API (i.e., cd.ChartData or ob.OrderBook in my code) returns error.
In that case, I want to repeat to call both of APIs even if only ...
0
votes
0answers
14 views
I can't getting response from PayUmoney gateway to my surl
I am doing one MEAN stack project. In that template is running on one port that is http://localhost:3000 and node server is running on another port that is 7200. I have successfully made integration ...
0
votes
1answer
19 views
when i set the token in header in angularjs generating error in nodejs server?
Error is:
Possibly unhandled Error: Can't set headers after they are sent.
at ServerResponse.OutgoingMessage.setHeader (_http_outgoing.js:344:11)
at ServerResponse.res.set.res.header
1.all ...
0
votes
0answers
8 views
How to make a network architecture without the server being authoritative
As a prototype i'm making a multiplayer paint game on a canvas using javascript and websockets. The conditions are that the server cannot generate the canvas in any way. All model logic happens on the ...
0
votes
0answers
8 views
while using webpack devserver, express session is not persistence in appl server
Am using below things in my learning project...
1) React/redux,node,express as app server which handled server side user login(runs in 3000 port)
2)Using ES6 in my both server and UI(react),
3)using ...
1
vote
1answer
13 views
Storing site config as Mongoose model
I have website configuration (currently stored as JSON file), and I would like to move it to MongoDB and probably use Mongoose to handle read-write operations and perform validation through schemas.
...
0
votes
1answer
19 views
How to programmatically force mongoose to query and return a certain field in a mongodb collection?
I have a password and salt stored in mongodb, I can query all other fields except the salt.
Here is the schema:
var userSchema = new Schema({
firstname : { type: String, trim: true},
lastname ...
0
votes
1answer
15 views
Webpack: window is not defined
I'm trying to expose one of my classes to global. However eslint tells me that "window" is undefined, It's not eslint problem because my class still not accessible even when I turn off eslint.
This ...
2
votes
1answer
30 views
Loop GET requests with incremental parameters
I am trying to GET data, from a lot of pages (same page, but different data). The problem, I think is with the async request method of Node, and the 'for' loop. (I'm new in nodejs).
I use a for loop ...
1
vote
2answers
21 views
How to handle conditional callbacks using Promises(Bluebird) in NodeJS
I am currently trying to refactor the codebase that I have and want to have a more developer friendly codebase. Part 1 of that is changing callback to Promises. Currently, at some places we are using ...
1
vote
1answer
14 views
Button Click in Jade of Node Js without Script Tag
I saw like this code for button click for Jade when I reasearch for Node Js button click
button(onclick=foo)
script(foo(){alert('foo');})
I dont want any script tag or any javascript code in my ...
0
votes
0answers
8 views
IBM Push : cannot use sendNotificationByDeviceIds in ibmpush.js
i have a application and use the function sendNotificationByDeviceIds as below:
PushNotificationToConsumer: function(req, res) {
queryCustomer.find({jpay_no : jpay_no}).done(function(...
0
votes
0answers
10 views
~bash: jpm command not found on mac
I already installed npm. My current version of npm is v3.10.8 .
Also I have installed firefox developer edition.
I have tried many possible ways to install jpm.
So here it is what I've done:
- npm ...
1
vote
1answer
30 views
What's the difference between using nodejs cluster and manually start several node instance?
I want to know the difference between:
cluster.setupMaster({exec:'app.js'});
for(let i=0;i<3;i++) {cluster.fork();}
and typing command 3 times:
node app.js
It seems that for the internal ...
2
votes
1answer
10 views
Sinon to unit test 'catch' statement
I've got a simple function such as;
module.exports = {
fetchUser:function(myUserId) {
return new Promise((resolve, reject) => {
this.getUser(myUserId)
.then(user => {
...
1
vote
1answer
27 views
How to improve aggregation query in mongoDB?
Let's say i have this 2 of huge documents:
[
{
_id: ....,
status: "A",
class: "DIP1A",
"created.user._id": ...,
"created.dt": ....,
"category": "private",
price: 100.00 //type double
}...