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
8 views
Error when trying to make 2 database calls
Thanks in advance for tolerating with my noobishness in nodejs.
I am making an api using swagger and node js using a postgres DB.
I have loaded data into the db and am calling it from the api ...
0
votes
0answers
5 views
How to stream a video every minute from Node.js
I have a big video collection (all of them 1 minute length) and I would like to play one of these videos every minute, so everyone that enters in the site will be watching the same video in the exact ...
0
votes
0answers
3 views
How to sign up user and then keep them signed in and access current user Parse Server?
I am trying to get a user to sign up, I have the HTML form working etc. I just need to handle the sign up itself.
The user is successfully created BUT I'm not sure how to keep the user logged in or ...
0
votes
1answer
7 views
Recommended node inspector version for node v0.10.38
I have node inspector setup to connect with my node app.
it works to an extent. In the beginning it stops due to the debug-break setting and it stops at the breakpoints I put in my config file. ...
0
votes
0answers
9 views
express setImmediate(function () { error
Im busy with a chat app with nodejs 6 socketio 1.7.2 express 4.14.1.
i can run node index.js but as soon as i access my page simplechat.html
it throws the below error. Please help
/root/Chat/...
0
votes
0answers
20 views
how to save json object from third party api
I'm having trouble figuring out how to save a json object from a third party api to my personal localhost mongodb. I believe I'm supposed to create another method within the api controller but am not ...
0
votes
0answers
4 views
Conflict: Multiple assets emit to the same filename
I'm a webpack rookie who wants to learn all about it.
I came across a conflict when running my webpack telling me:
ERROR in chunk html [entry]
app.js
Conflict: Multiple assets emit to the same ...
0
votes
0answers
12 views
Retrieve a JSON from API on node.js
I'm trying to retrieve a json file from an API without success.
var https = require('https');
var options = {
host: 'host',
limit: '1000',
offset: '0',
path: '/users',
...
0
votes
0answers
8 views
In socket io, one user connection creates dozens of “joining room”?
I have a nodejs socket.io application on linux connected to clients running socket-io-client.
The nosejs server is:
node v6.7.0
express 4.10.8
socket.io 1.4.5
the java side is using maven:
<...
1
vote
0answers
6 views
How can I stubs exported functions from a Node.js module with sinonjs?
I have a myModule Node.js module containing:
function b() {
console.log('original b');
}
function a() {
b();
}
exports.a = a
exports.b = b;
And the following test suite using mocha + sinon.js:
...
0
votes
0answers
8 views
Stacking of Context Menus in Electron
I am building an Electron based application that contains a grid containing unique rows. I would like a context-menu that is specific to each row. Here is an example:
Although this screen shot is ...
0
votes
0answers
4 views
Amazon MWS is there REST version API?
I have client which is interested to build product based on Amazon MWS API , but one which I found is actually XML. I use to work in REST JSON formats - is there any alternative? Is there any of Beta ...
1
vote
0answers
17 views
Why the callback never gets called when reading all data from MongoDB?
I recently updated my machine to the Node.js version 7.5.0 (if I remember well, I was using version 4 before).
One of the applications which worked before doesn't work any longer. The problem could ...
0
votes
0answers
8 views
Converting Node.js HMAC to C++
Ive been working on a project, and as part of it I need to convert the Node.js code
var hash = crypto.createHmac('sha512', key).update(text).digest('hex');
to C++. I've decided to use Crypto++, ...
0
votes
0answers
5 views
Upload file with swaggerize-hapi and node.js?
I am creating an API endpoint with POST verb and it takes a file. I declared my endpoint as following:
consumes:
- application/json
- multipart/form-data
# format of the responses to the ...
0
votes
0answers
6 views
Azure DocumentDB auth header in R
I'm attempting to generate the Azure documentDB auth header for REST API calls using R instead of the C# and Node.js code snippets provided by Microsoft.
I'm specifically running into issues ...
0
votes
0answers
8 views
Multiple pipes on writeStream open event gives undefined
I am downloading a file from a URL and then I want to write the metadata for that file to the destination stream only after I make sure that the destination file is created(i.e. after fs....
0
votes
0answers
7 views
Alexa- audio issue
var Response = require('alexa-response');
//first intent
LaunchRequest:function(){
//Type 1 gives an error saying the "response is not valid" when tested in the developers console.
//the ...
1
vote
1answer
16 views
How does NPM handle version conflicts?
Since NPM version 3 node modules and dependencies are all installed at the same root level. But what if I install two modules that depend on two different versions of the same module? For instance, if ...
0
votes
0answers
14 views
How to change color image (jpg,jpeg,png) to black and white or grayscale in node js
I used all npm package that support grayscaling but nothing is working properly.
Some of them are working but quality reduced.
there is a good grayscale package named image-grayscale but problem is ...
0
votes
2answers
24 views
How to chain a variable amount of methods on node js?
I'm using Nightmarejs to scrap a website. I want to chain multiple operations (promises?) depending on some input. Take the following code:
var Nightmare = require('nightmare');
var nightmare =...
0
votes
1answer
22 views
Why does this code error on Lambda when wrapped inside exports.handler?
I'm using this casperjs nodejs app: https://github.com/narainsagar/node-casperjs-aws-lambda
I've gotten my code to work locally and when uploaded to Lambda, but I need to wrap my code inside exports....
0
votes
0answers
8 views
Is there a generic approach to dev amazon echo skills and google home actions?
Is there a generic approach to develope amazon echo skills and google home actions?
0
votes
1answer
11 views
How can I make VSCode run a node app like “npm start”?
I have a node app with the package.json like so:
{
"name": "myexpressapp",
"version": "0.0.99",
"scripts": {
"start": "node ./bin/www" },
//etc
}
and in app.js I have
...
0
votes
1answer
14 views
Pug file not loading CSS
I've got an express project set up. I'm using Pug as the view engine.
I've got the following lines in my app.js,
app.set('views', path.join(__dirname, './views'));
app.set('view engine', 'pug');
app....
1
vote
0answers
15 views
I'm trying to re-render my pug template through setInterval(). Is this possible?
I'm trying to re-render my pug template through setInterval().
I'm trying to have a page display live data from a MySQL server. I can get the data to the page but I don't know how to update the data ...
0
votes
0answers
10 views
How do I access the additional columns in models that inherit from a parent-type when querying Bookshelf.js
In my project, I have a parent table 'Tasks' with fields like 'owner_id' and 'title'. I also have two specific variations of Tasks called 'TaskFind' and 'TaskFix'. These both extend the 'Tasks' table ...
0
votes
0answers
7 views
Data structure and approach for webshop in node.js
I want to create a webshop in Node.js.
It should be possible for both registered users and non-registered users to buy something, so I guess I need one model for users and another model for carts.
...
0
votes
0answers
3 views
Node.js sticky-session, what if mobile IP has been changed?
We know sticky-session uses hash of IP address to make each client connect to same cluster(or process). And instead, I use sticky-cluster which has same principle, but much better.
Then... what if IP ...
0
votes
0answers
7 views
Can I serialize/deserialize BSON from node to angular app?
Can I expect to be able to serialize an object on my node server, send it over to client angular app via. express response and then deserialize it in angular app?
Here's what I have in node:
var ...
0
votes
1answer
8 views
Referencing node modules in Electron?
I'm a recent refugee from the Flex/Actionscript/AIR world and am loving working with Electron, Node and beginning to understand some of the conventions of working with Javascript.
Question: I've been ...
0
votes
2answers
9 views
Selecting a random record from Sequelize findAll
I'm currently brute-forcing this, but am confident there is a better solution that uses Sequelize, the code in question (using postgres):
...
then((tile_data) => {
return Encounter.findAll({
...
0
votes
0answers
11 views
Nightmare JS updating MongoDB + Mongoose with retrieved data not working
I am looking to scrape data from specific URLs and updating an existing data in MongoDB. I am also using CRON (not sure if that has any affect on the code). Below is the code:
module.exports = new ...
1
vote
0answers
9 views
How do I override passport authentication when unit testing using mocha/chai?
I tried setting app.request.isAuthenticated = function(){return true;} as was recommended in another answer but this didn't work for me.
This is the authenticate method that I use as middleware on ...
1
vote
2answers
28 views
Am I hashing passwords correctly?
My current project is my first in Node.js (also using MongoDB, Mongoose, and Express, if it matters), and being easily distracted, I have fallen down the rabbit hole of crypto while deciding how to ...
0
votes
3answers
18 views
how to bring variable from out the function? - node
app.get('/:id', function(req , res){
var ID = req.params.id ;
//converter...
var dl = new Downloader();
var i = 0;
dl.getMP3({videoId:req.params.id},function(err,res){
i++...
0
votes
1answer
19 views
promise flow - bluebird
I'm trying to use ffmpeg to cut a few seconds of a directory with mp3s.
But my actual problems comes with using promises.
Instead of starting one ffmpeg process after the other it starts up one for ...
0
votes
0answers
14 views
Async queue, filestream end how to know when both finished
I am having a slight issue when using async.queue with a filestream
I have a scenario where my filestream will finish
I set fileRead to true
however the queue will be empty and already have called ...
0
votes
0answers
9 views
How to keep Sequelize data models separate from local data models
I've been using sequelize in my Node.js app (written in Typescript) for a while now, and I really like how it simplifies simple queries. However, I'm having a hard time deciding what the best way to ...
-2
votes
0answers
10 views
How to make a crash game like bustabit.com
I'm asking how to generate a purely random number to use for my website like www.bustabit.com.
I have it hosted through expressjs and authenticating socket.io with passportjs.
Don't need exact code, ...
0
votes
1answer
8 views
nodejs: check until URL get's online
I need a "forever-watchdog" for checking if an URL is reachable or not. My case is that I have to see if a media stream gets online, and if, I would need to run a shell-script. If it's not reachable (...
2
votes
2answers
19 views
How to synchronize backend timer with mobile app
I am developing a app that chooses a user and has a 15 sec. timer for that user to respond. The user app queries the db every 5 sec to see if that user is chosen. If so The mobile app begins a 15 sec. ...
1
vote
2answers
29 views
Node.js can't make request to zomato.com
I would like to make request to https://zomato.com/ but there is no response, I am able to connect anywhere else but not to zomato I get timeout error every time. I was trying to set user-agent but it ...
1
vote
1answer
14 views
Where do I put this line of code on the new file structure of Meteor?
I was redirected here from the Meteor.com website. I am new to this Javascript library and while I have a conceptual framework of how it works I wanted to get some real world experience with it. ...
0
votes
0answers
6 views
Use node-google-finance and node-yahoo-finance in front-end
node-google-finance and node-yahoo-finance are all written in node.js.
I know, in front-end, we could use api and send a http query like in here. My question is whether and how we could use the ...
0
votes
1answer
13 views
intercept network request using fiddler in sails.js
I've a sails.js app which makes api request in third party (for an example marketo api) to get data.
Is there any way that I can set a proxy in sails.js so that I can see all the request made by sail....
-1
votes
0answers
5 views
Passport SAML + ADFS Login and Logout not working
I have a Windows Server 2012 r2 and ADFS has been installed. I configured trust party for SP in IdP, and from passport SAML I could login successfully. But, while printing profile details, it says req....
0
votes
0answers
14 views
require('oracledb') unable to evaluate the expression
I am trying to create conection of oracle using node-oracledb package. I have installed it. But when I try to create object it is throwing error.
var oracledb = require('oracledb');
This is throwing ...
0
votes
1answer
30 views
How to execute route even if file is not send
I have this atm:
var multer = require('multer');
var upload = multer({dest:'./public/upload'});
var session = require('express-session');
var multipart = require('connect-multiparty');
var ...
0
votes
0answers
14 views
Node.js “Require” Definition
Um im creating a mod and im making it connect to the wesbite so it could get the sourcecode but it would let me because require is not defined can someone give me the variable for "require"