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
2 views
Nodejs, Typescript, typings: how to use async library
I'm trying to use the async library in Typescript; I've installed the definition file that was provide by typings but I cannot use AsyncFunction:
///<reference path='typings/index.d.ts' />
'use ...
0
votes
0answers
10 views
nodejs commander.js 'alias' not working as expected
I am working with commander.js for my project and I am facing a weird issue when giving an alias for a command. I referred to examples mentioned here: Commander.JS Example
I am looking for creating a ...
0
votes
0answers
5 views
Nodejs payumoney integration - hash key generation issue
I am trying to create hash key in node js. For this I installed sha512 plugin using
npm install sha512
And I tried the below code:
var sha512 = require('sha512');
var marchentKey = 'gtKFFx';// '...
0
votes
0answers
12 views
express app.get(' /* ') and api CORs issue
can you tell me how I can get my json api?
server.js
app.get('/*', function(req, res) {
res.sendFile(path.join(__dirname, 'public', 'index.html'));
})
app.get('/api', function(req, res) {
...
0
votes
0answers
6 views
How to get more data and append to document, with Meteor
I'm very confused on how I should ask for more data, for example, using an API, and append it to the list I already get.
Let's say we have an infinite scroll feature or a 'load more' button and when ...
-1
votes
0answers
11 views
Cipher encrypting the same string to different string?
On registration I am encrypting the password and storing it in DB. On login, I am again encrypting the password and trying to match with the password in DB at the time of data retrieval as SELECT * ...
0
votes
1answer
8 views
Merge JSON arrays by matching property in Nodejs
I have two JSON arrays in Node.js.
var a = [{id: 1, name: 'A'}, {id: 2, name: 'B'}, {id: 3, name: 'C'}];
var b = [{id: 1, marks: 80}, {id: 2, marks: 30}, {id: 3, marks: 76}];
I want to merge these ...
-1
votes
0answers
9 views
Microservice framework or toolkit for nodejs [on hold]
I am trying to create RESTFUL Web-services in such a manner that it should be decoupled easily and every web service should be of type 'plug n play' . by using the phrase 'plug n play' I meant that at ...
1
vote
0answers
4 views
WebSocket connection to 'ws://…/socket.io/' failed: Error during WebSocket handshake: net::ERR_CONNECTION_RESET
I am using nginx and proxying to my app that uses socket.io on node.js for the websocket connection.
I get the error above when accessing the app through the domain.
I have configured nginx ...
0
votes
1answer
4 views
Redirect to HTTPS with Node/Express on Elastic Beanstalk
I'm trying to get a site to force HTTPS (redirect from HTTP). We've got HTTPS set up via AWS Elastic Beanstalk. The problem is that, currently, both HTTP and HTTPS can be used.
After reading through ...
0
votes
0answers
14 views
How to force all stream done before we continue with other task?
I'm using nodeJs code to create a function to download image from A repository and then upload to B repository.i want to force all stream done before we continue with other task and trying with this ...
1
vote
0answers
13 views
Docker build times long with npm global install angular-cli
I have encountered a very strange scenario and was wondering if anyone was able to shed some light on the situation. In short, docker build with npm install -g [email protected] along with the ...
0
votes
0answers
6 views
handle requests from angularjs to nodejs single service using sequelize literal?
JSON data request from client side in different ways like this
client requests from angular as filters with different parameters to single service which is in node Js.So this nodejs code handle ...
1
vote
2answers
11 views
NodeJS JSON Schema Validation not working
I'm a complete newbie to JSON Schema Validator, but I think is very powerful. However, I just can't validate one JSON.
This is my Schema
{
title: "Example Schema",
type: "object",
properties:...
0
votes
0answers
9 views
Why would node.js+node-java that uses Sync calls be faster than using non-Sync?
I have written a small web server that I wrote in node.js that uses node-java to invoke a commercial product API. I originally used (mostly all) Async (non-Sync) calls to invoke that API, as shown ...
0
votes
1answer
8 views
Node / Express & Postgresql - when no rows match
Hello I am new to Postgresql and I wanted to learn how one handles 0 results as an error is thrown. Essentially I want to get a user if it doesn't exist, return null if one doesn't, and have an error ...
0
votes
0answers
15 views
Include CSS and JS in HTTP server?
I saw that you can use connect to use serve static files in a Node.js HTTP server like this:
var http = require('http');
var connect = require('connect');
var app = connect().use(connect.static(...
1
vote
0answers
4 views
node.js steam priceHistory
I've found a similiar question and an answer, but still failed.
Question; How to retrieve steam market price history?
I've tried setting the Cookie key to my steamLogin session id but failed, what I ...
0
votes
1answer
8 views
npm install installs, but node_modules is empty
I have a VM on digital ocean running Ubuntu 16.04. I installed node and git. I am pulling my repo, and trying to install all dependencies.
I run npm install inside my project folder. Everything looks ...
0
votes
1answer
14 views
nodejs keeps running forever
I'm writing a script in nodejs that will collect some transactions in the mongodb, post it to a API and the it should be done (and go back to cli). I have something like this:
var request = require('...
0
votes
1answer
11 views
Click function not executing executing Nightmare.js
I'm trying to do some scraping with nightmare and my work is almost functional. The problem is that I'm facing an issue when I try to perform a click() after the evaluate() and run() have been called. ...
0
votes
0answers
15 views
Decoding the response body from azure functions
I am trying out azure functions. I understood about the working of azure functions and necessary bindings for combining the functions with other azure services.
Scenario:
Posting JSON through ...
0
votes
1answer
15 views
exporting a typescript variable with its type information
I have a certain config variable with an interface.
//I declare my interface
interface ServerConfiguration {
development: {
db: {
url: string,
user: string,
password: string,
...
-1
votes
0answers
8 views
mongodb sorting arrays using aggregate function
my problem is, i have photos with comments, and i want to sort them out. for example, i want to show first the photo with the most number of comments, least number of comments, newly submitted photo ...
0
votes
2answers
19 views
POST request not able to find url
I am new to nodejs as well as developing.
I am trying to get a set of data bat from a nutrition site in JSON format. If I formulate the url with my app and api keys along with criteria to paste into ...
0
votes
1answer
7 views
proper way to reference documents with Mongoose
I see in all examples the suffix "_id" on a field referencing to another document.
Example:
record: {
_id : ObjectId("57f2fb5d1c6c3b0de45b170e",
artist_id: "prince" )
}
artist: {
_id: "...
0
votes
0answers
4 views
node-schedule how can I access the current rule which is being executed?
I've got node-schedule setup to create multiple cron jobs, these cron jobs are created dynamically in a loop. The code inside the schedule.scheduleJob callback needs to access to the current Rule ...
0
votes
1answer
16 views
Don't know where to install the modules
I am currently getting to grips with angular using a book, currently on testing. So I have the tutorial project folder set up in localhost C:\xampp\htdocs\projects\learningangular. So I installed ...
1
vote
0answers
11 views
Mongoose text search returns empty array
I've been through all the other SO questions, all the docs and can't figure out what the hell I'm doing wrong here. I just need to get the text search working and then I will flesh out how the api ...
2
votes
1answer
18 views
Updating client after processing task in queue
A Firebase client can add a task to a queue like so:
var tasks = db.ref('quote-request-queue/tasks');
tasks.push({'need': 'quote for customer'});
This task represents a request to get a price quote ...
-1
votes
0answers
13 views
Webpack or Express which one will be better way for react.js?
I am newbie at react.I try to make a small project in react.I saw that some people use express for react and other suggest to use webpack.My question is that which one will be better fit for small ...
2
votes
0answers
13 views
Cassandra - Wrong timezone being used when inserting
This is the date I'm trying to insert into my database:
'1970-01-18T00:00:00+00:00'
But when I look at the entry in the database it's 8 hours behind:
1970-01-17 16:00:00
The time zone used on ...
2
votes
0answers
11 views
Firebase queue - blocking and not-blocking between workers
The following is standard code, adding tasks to a queue, and then the worker pool will process the tasks. What I am confused about is what it means to have more than 1 worker in the queue, as I don't ...
0
votes
0answers
8 views
Mongoose - Populate not filtering correctly
I want to only return the friend objects in the array where the status is "active". Yet, when I do the get request, I am still seeing friends with status "pending".
Here is my index controller:
...
0
votes
0answers
7 views
How to include send message and inbox option in a Node.js web application
I want to add a send message and inbox option in my node.js application. Basically the website is all about posting jobs in the forum, where three types of people can search and post jobs according to ...
1
vote
1answer
18 views
Comms between node-ipc and C using unix sockets
I want to communicate between NodeJS and a C program using node-ipc, over a Unix socket, which according to that homepage is the fastest option. (They will be on the same machine). That package claims ...
-1
votes
1answer
3 views
Create sockettimeoutexception with node js server
So I modified the accepted answer in this thread How do I shutdown a Node.js http(s) server immediately? and was able to close down my nodejs server.
// Create a new server on port 4000
var http ...
1
vote
0answers
13 views
nodeJS environment variable value containing equals sign character
Are there any characters which need to be escaped in a nodeJS environment variable value (such as the equals sign character)? I have a variable with value as shown below - MY_VARIABLE=OU=MY_OU,DC=...
1
vote
0answers
9 views
determine image type and write response headers with readStream
How can I read the image type, jpeg, png.
var readStream = fs.createReadStream('images/thumbnail'); // jpeg or png
readStream.on('open', function(){
})
// fs.stat
response.writeHead(200, {
'...
0
votes
0answers
8 views
npm install error on laravel-elixir
I got the following error when running npm install laravel-elixir --no-optional --no-bin-links on my virtual machine:
npm WARN deprecated [email protected]: ReDoS vulnerability parsing
Set-Cookie ...
1
vote
0answers
12 views
passing variable info in a session in Express
I am new to Express sessions and was hoping I could get some help as to passing along variables using express-session.
Essentially I am using passport to allow GitHub logins, and I can get the user's ...
0
votes
1answer
16 views
How to handle the node server side with react
Im working on react and node project. Im new to both technologies, and i developed a system for my internship. But I feel like, I didn't handle the server side (Node part) properly. This is my server ...
0
votes
0answers
6 views
How Express.static decides a relative path
All:
I wonder when I use express.static with a relative path like
app.use(express.static('./dist'));
How do I know what is the root directory? One interesting thing I find is:
If I run node ...
0
votes
0answers
24 views
NodeJs Sql issue
I am using NodeJs call back function and executing 2 sql queries inside it. But getting an unexpected result. I believe its a callback issue, but could not figure it out.
exports.addProducts = ...
0
votes
0answers
10 views
Not able to create a dynamic Regex in mongoose query
I am trying to create an aggregation queries with mongoose with NodeJs.
I want to create a query object like (it is a part of a query),
{ $or : [
{ title: /some-regular-expression-text/,
...
0
votes
1answer
14 views
SSH to a created EC2 instance through NodeJS implementation
My code looks like below: -
AWS.config.update({ region: 'us-east-1' });
var ec2 = new AWS.EC2();
// Create the EC2 instance
ec2.describeInstances(function (err, data) {
if (err) {
...
1
vote
1answer
7 views
Nodejs Website doesn't display second mysql table value
I have a express website that display values in the mysql. It displays the news but it doesn't display events. I know for sure that the events table has 2 values in it.
here is my index.js file in ...
0
votes
0answers
10 views
Refresh api query with Node.JS & Heroku
I'm building a messenger bot that queries an API once a day and sends the information contained there to users. it's hosted on Heroku and uses Node.js
I'm currently using this to query the API:
var ...
0
votes
1answer
13 views
MongoDB connect failed
My problem here is that even after setting up mongod.exe "mongod.exe --install --logpath c:\mongodb\logs --logappend --dbpath c:\mongodb\data\db --directoryperdb", when i start up mongo.exe on ...
0
votes
0answers
12 views
Error “socket hang up” - ECONNRESET
I have a node.js application running on AWS EC2 and RDP MySQL instance. When i run a certain DB operation, the error below on the console. But I notice that the operation is performed correctly. Also ...