« first day    last day (77 days later) » 

12:01 AM
frozen as duplicate of Node.js by Doorkn-- wait, I don't get my mod diamond here because this is chat.stackoverflow. You're lucky. :P
 
@Doorknob it was mainly done just to show how easy it is to give ownership. @SomeKittensUx2666 asked in the other one and was denied for weak reasoning imo
 
@Doorknob Yeah, the other node.js room will be dying fairly soon.
 
lol
damnit the refresh killed my text
Im not a huge node guy
so it seems weird for me to be an owner
 
12:05 AM
oops - it's cool
 
0
Q: How to handle csrf when file upload in express3?

ErikI use csrf protection in my express3 application like the following: app.use(express.csrf()); But unfortunately it does not work when I use file uploading with enctype="multipart/form-data": form(method="post", enctype="multipart/form-data") p input(type="file", name="file") p inp...

0
Q: Tail on flash game graphic when using ng-include, no tail on graphic without

ewizardI just embedded a flash game on my website (angular/node/express) using http://ngmodules.org/modules/angularjs-media like this: <div class="container hero-unit"> <flash width="400" height="300" src="files/avoider.swf"></flash> </div> The thing is, I have a navigation bar that I want to inclu...

-1
Q: How log express.js POST parameters

VadorequestI'm wondering how to get an array that contains all parameters sent in a HTTP request. If I read the doc: http://expressjs.com/4x/api.html#req.params I can see that using req.params and req.query, params will be linked to the route parameters and query to the GET parameters. But how can I log t...

0
Q: Angular, Express, and HTML templates: View layouts and routes?

Kevin SuttleI feel like both Express' and any MEAN stack tutorials gloss over this, so I decided to ask here. Using plain HTML with Angular directives/attributes as the view engine in Express, what's the best practice for rendering page partials in a single layout template with regards to routes? How do ...

0
Q: Anyway to implement Meteor like data subscription in Node.js

Sean YangI am using Express.js for one of my projects, basically, what I am trying to achieve is simple: the page displays a list of entries pulled from the data mongodb collection when user adds an new entry, client side jQuery collects the input and fires an AJAX call to the server script server cod...

 
room topic changed to node.js: Command center for the Node.js tag [express] [horse-grooming] [javascript] [node.js]
 
12:45 AM
0
Q: Making a mongoose model aware that it is nested

Ryan WhealeConsider the blog/comment schemas where nesting is appropriate (even if you disagree): var CommentSchema = new Schema({ name: String, body: String }); var BlogPostSchema = new Schema({ title: String, comments: [CommentSchema] }); I understand how to add, update, delete comments for a blog post...

 
 
2 hours later…
2:31 AM
0
Q: Koa and Firebase Error Handling

user2488234I'm attempting to move my API which connects to Firebase to Koa. Just starting out, it seems I have issues with error handling. Here is the code: app.use( function *(next) { try { var checkAuth = firebase.auth( FirebaseToken, function (err) { if( err ) { ...

 
3:14 AM
0
Q: Best way to separate functions into models using Node / Express?

Raphael CaixetaI started an Express app that will only serve as an API tool, so I setup the route for the API. This API will be checking various different sources for certain data and end the response in a JSON object. I have the entire API working and all the different functions already written - my problem is...

 
4:08 AM
0
Q: BigQuery / Node.js timestamp way off

mungojerieDoing a streaming insert into Google BigQuery, from a light Node.js app, using this package: https://www.npmjs.org/package/bigquery I generated a timestamp on my server via this simple line of code: jsonData['createdAt'] = new Date().getTime(); I then insert that into BigQuery, into a field w...

 
4:30 AM
0
Q: how to configure socket io in server to get acknowledge (SocketIOCallback) from ios socket

JithinI am developing a chat app in ios with node.js and socket.io. I use SocketIOCallback to send acknowledgement. But i don't getting any acknowledgement on server.js. Here is the code i use to send acknowledge SocketIOCallback cb = ^(id argsData) { NSDictionary *response = argsData; // do s...

0
Q: Error when running doctorjs on a node.js/express project

tivoniI'd like to get tags working in vim with my node.js project. I use a doctorjs github clone, following the tips in this stackoverflow thread (I had to work around this doctorjs issue). So, I create a new express project: express test cd test && npm install Next try to generate the tags: jscta...

0
Q: socket.io not functioning on Heroku

user2684308I am unable to get my Node.js chat application to run on Heroku platform. Running the application locally works fine. I included a configure method after viewing other posts on the subject. var port = process.env.PORT || 3000; var io = require('socket.io').listen(server); io.configure(function...

 
 
1 hour later…
5:58 AM
0
Q: File transfer from server to client Node.js

AliKhokharI'm trying to send files between client side browser and a remote server ('the cloud') using SSH. For this, I've developed a Node.js webserver as a middleman. For file uploads, my Node webserver receive requests from the user and uses the ssh2 module to transfer it to the remote server. The follo...

 
6:23 AM
0
Q: Cannot call method 'findOne' of undefined at Object.module.exports

user3387029var mongo = require('mongodb'); var mongoose = require('mongoose'); var db = mongoose.connect('mongodb://localhost/subscribe'); var mySchema = new mongoose.Schema({ _id : String, name : String, phone : String, age : Number, password : String }); var User = mongoose.model(...

0
Q: How to Access Redis Session outside of route (req.session) for use in Websockets?

1ManStartupHow can I get the a session outside of an express route, for example, i currently get my session like this: app.get('/',function(req,res){ req.session.foo = "Mike"; console.log(req.session.foo); // Mike } But how can I do something like this, basically accessing and changing the session from ...

0
Q: Cannot call method 'ui' of undefined

MortalFoolusing node with JADE as view engine. Im just trying to get into some page testing following a book called "Web Development with Node and Express." Im getting following Error: Cannot call method 'ui' of undefined When i try to call mocha.ui 58| script(type='text/ja...

 
6:47 AM
0
Q: mongodb native driver get collection names without database name

user3386802How can I get collection names without database name from mongodb native driver for nodeJS? db.collectionNames(function(err, collections) { if (err) { log.error(err); } else { log.info(collections); } }); This code returns something like this: databas...

0
Q: iterating javascript object in jade

user3590960I'm sending a view via my controller in sails.js that has layout parameters i.e. title and users: module.exports = { index: function(req, res) { User.find().done(function(err, users) { res.view('home/index', { title: 'Tester', users: JSON.parse(JSON.stringify(users))...

 
7:48 AM
0
Q: How to read the file using line number - node.js?

karthick.kI am working in node.js. Requirement: Note: Log - directoryName(Contains log files) Have to listen to the log directory change. If any log files added to the log directory, I have to read the particular added log file. If any content is appended to the existing file. Have to read that part...

 
8:17 AM
0
Q: Does Golang have callback concept?

A-letubbyI found many talks saying that Node.js is bad because of callback hell and Golang is good because of its synchronous model. What I feel is Golang can also do callback as same as Node.js but in a synchronous way. As we can pass anonymous function and do closure things So, why are they compari...

 
8:52 AM
0
Q: nodejs editing a date - unexpected behavior?

QweickI am editing a date in nodejs like so: But instead of adding x hours it moves the date several days in future. Does anyone have any ideas what causes this?

0
Q: Access MongoDB using Nodejs

user3153306I have an HTML 5 / Javscript application saves data in MongoDB using C# web services. I believe we can access MongoDB using Node js . SO this is like accessing MongoDB using javscript. How do I invoke the data-access script from the frontend, say on click of a button. Right now, this button click...

 
9:03 AM
0
Q: When using the *sync functions in Node.js, what (if any) background operations continue to run

GaryWhen using the Node.js *Sync functions (I understand you shouldn't, and the reasons why), what (if any) background processes continue to run? For example, if I'm using http.createServer, and from one of the requests I call fs.writeFileSync(), will the server continue to serve new clients whilst ...

0
Q: Is it better practice to do multiple operations on one line, or to spread them out?

hguantI'm coming to Node.js from a C background. I'm producing code like this: var fs = require('fs'); function reader (error, data) { var str = data.toString(); str = str.split('\n'); var x = str.length; console.log(x-1); } fs.readFile(process.argv[2], reader); While t...

 
9:21 AM
0
Q: What are _getpid calls in v8/node.js used for?

Thomas FankhauserI just profiled a node application with the --prof option and used the v8/tools/mac-tick-processor to create a statistical profiling result. The application requests a server on localhost using node.js's default http.request() method. It makes a request, waits for the results and then starts the ...

-1
Q: Advice: NodeJS, PHP, Python or other for MongoDB website?

Peter MorrisI want to develop a website with a high amount of data-update traffic, use Twitter as an idea, or perhaps the comments section of YouTube. I've decided to use MongoDB for storage for various reasons but I am not sure what to use to develop the web front-end. I know I want it to run on Linux, and...

0
Q: Why does node.js need python

binithbI am starting up with node This is from node.js README.md Prerequisites (Unix only): * GCC 4.2 or newer * Python 2.6 or 2.7 * GNU Make 3.81 or newer * libexecinfo (FreeBSD and OpenBSD only) Curious to know why does node.js need Python ? Does it use Python underneath its API

 
10:00 AM
0
Q: node webkit installer for a single user

user3647291I have created a software using nodejs and express, I packaged it and created an executable using node-webkit. I will deliver the file to my client. But the problem is that if my client copy the files and put it on another computer, he can still use the app. How do I create an exe file using node...

 
10:14 AM
0
Q: Fail to upload files from AngularJS to ExpressJs

George JorI am now using angular-file-upload packages to upload files. After I press item.upload(), it claims to be successfully uploaded the file, but I see the req.body is empty. Please Help! Here is the angular code to handle it: var uploader = $scope.uploader = $fileUploader.create({ scope: $...

0
Q: How to begin with Node.js

JobiI'm a very beginner in Node.js. So could you please let me know the following: What are the tools to be installed? Where to write the code? How to execute the code? How to debug? Just explain how to make a Hello world program.

0
Q: Visual basic, 1 dimensional array to string error

user3647346The program keeps showing me the "Wrong username" msgbox. I compare "navn" against file. I write the right username and password, but the msgbox keeps popping up Dim R As IO.StreamReader Dim LogInSom As String Dim Navn As String Dim Kode As String Dim OKnavn As Boolean Dim Ko...

0
Q: SailsJS/NodeJS managing asynchronous nature

Sambhav SharmaI have a code in my controller, that works on an http request, to save a post that user added in the front-end. So I do something like, Model.create(). Now what happens is on the call backs I want to return whether the post was successfully added or not, so that my front-end could show appropriat...

0
Q: login persistence in browser req.user (node.js, mean.io)

bannndiI'm following with tutorial "Building AngularJS and Node.js Apps with the MEAN Stack", and just stuck with "04. Persisting Login between Page Refreshes.mp4" As said in this part of tutorial, some middleware function must console.log req.user object. But it is not happening. package.json's depe...

 
10:46 AM
0
Q: Store the uploaded files into file system in Express Js

George JorI am new to nodejs and want to know how to put a file into my system backend or even upload it to S3 etc. Here are the file object: req.body { homeColor: 'black', guestColor: 'white', thirdColor: 'red', file: { webkitRelativePath: '', lastModifiedDate: '2014-05-05T02:26:11.000Z'...

 
11:10 AM
0
Q: Sequelize Express.js Associations

user3647423Im trying to do a simple two way association between two models. Account hasMany Purchases Purchase belongsTo Account. On creating new purchase, should I exports.create = function(req, res) { db.Purchase.create(req.body).success(function(purchase) { purchase.setAccount(req.body.accoun...

0
Q: send emails to different receiver with different message nodejs

ManishHow to send emails with different messages in the body. I know how to send the same message to different people but don't know how to send different message body with particular pattern to different receivers. `var mailOptions = { from: "xyz <xyz@gmail.com>", // sender address to: "abc@a...

 
11:51 AM
0
Q: node.js and socket.io connections/disconnection events

user3455531I have a few questions about connections/disconnection events of node.js socket.io. Consider this simple code: io.sockets.on('connection', function(socket) { socket.on('set username', function(userName) { // insert into a database the username with socket.id }); socket.on('disconnect', f...

 
Hi I'm stuck in express with node.js and want to provide custom code support for my clients. Help Needed
 
0
Q: Updating a document by replacing with a given object, mongodb

user1572526I have rest service with nodejs, express and mongoose. This is a update where a document in a collection is replaced with a document given by user. So it's a update. exports.updateMaterialForUser = function(req, res){ var givenMaterial = JSON.parse(req.body.material); mongoose...

0
Q: Mongo db findOne query will not stop

George JorI am using express js and angular js, but I found that the findOne method will not end. For every request, the backend function will get the obj first before doing CURD stuff: exports.article = function(req, res, next, id) { Article.load(id, function(err, article) { if (err) return...

 
12:24 PM
0
Q: 502 Gateway Error on AWS - API

user3645784I am creating a test web app and have deployed it to AWS Ubuntu server using nginx.. I am getting a 502 Bad Gateway error when it tries to reach my API.. I am new to this and have started node.js and all seems to working fine except when I want to perform an API call to mongodb to read or write...

0
Q: Object.keys execution-time

user3054852I did some benchmarking on my setup (i7 @ 3.07GHz, 6GB ram) with the Object.keys method and noticed some interesting results. This is the code I tried: var foo = {}; for (var i = 0; i < 600000; i++) { foo[i] = true; } console.time("foobar"); var keys = Object.keys(foo); console.timeEnd(...

0
Q: How to avoid infinite loops in http+rest server calls using Node.js with Express

vashishatashuI'm stuck trying to avoid infinite loops in http rest calls. I'm using Domain API of Node.js to avoid calls from stopping my server. function runInDomain(req, res, next) { var reqd = domain.create(); reqd.add(req); reqd.add(res); reqd.on('error', function (err) { writeJSONResponse(r...

 
12:47 PM
0
Q: Express.js 4.x session undefined after migration from 3.x

DamianI have migrated my application from Express.js 3.x to 4.x. I have done all changes described in migration guide. Unfortunately, when I try to get session from request object it is undefined. That is how I set express.js as far as cookie parser and session are concerned: app.use(cookieParser());...

 
12:58 PM
1
Q: Why does node.js "injects" 3 DIVs at the bottom of each HTML rendered to the browser?

NightOwlI see that in my node.js apps, all html files generated back to the browser have 3 strange DIVs: <div id="hrUEoB6QvVpGs3Es" class="qlg5qGErCB54seZV66a0vA2ej" style="display: none;"></div> <div id="_F_hxffOOh_6ZHFIeMDRoqsm4" class="qlg5qGErCB54seZV66a0vA2ej" style="display: none;"></div> <div id=...

0
Q: How Cex.io is Updating its trading stats

user3647636I am wonder how http://cex.io is updating its trading statistics without sending any request to server means(when while using chrome ,I opened network console to see the number of request sending to server but I get shocked after seeing that the server status are updating and network console did...

0
Q: how do I access an object's deep atribute using a bracket notation in Javascript

coisoI want to do this: market['global']['name'] Like this: market['global.name'] Why? Because it would allow to loop through an array with different 'routes' instead of having to create a ton of exceptions

 
1:30 PM
0
Q: Get SASS to autocompile with NodeJS Express and node-sass

IzhakiI'm developing using node.js, and instead of writing css would like to write SCSS files that auto-compile whenever I refresh the page. How can I get SASS files to autocompile when using NodeJS, Express and node-sass.

0
Q: not able to send response from nodejs and capture it in jquery

PulkitI am trying to send message in response from nodejs function and then want it to capture by ajax jquery and print it on client id but I am always getting Error [Object object]. Here is my code snippet\ Server.js router.post('/checkUser', function(req, res) { console.log("checking user"); var db...

0
Q: node-mongodb-native remove by DBRef $id (dot issue)

user1918648I have 2 collections in my mongodb database: users and posts. And in posts collection I have DBRef field like this: user : DBRef('users', ObjectId('...'), null) When I'm going to remove some post by user id, I do the following: db.posts.remove({ 'user.$id' : ObjectId('...') }) And it works ...

 
1:54 PM
0
Q: Google maps - dynamic layers

user3647715i'm creating game like ingress. I want gather position data from smarthphone and send them to my server. I will do some computing on the server side and then i want to serve data back to different clients and show them on google map. My problem is how to load only data from region where is user l...

 
2:11 PM
0
Q: MongoClient.connect blocking in NodeJS: async.map()

apatrickI have three databases, each with a collection called 'items' in MongoDB which I would like to connect to from node.js. Before starting the connection, I obtain an array containing the names of these databases and then I use async.map() to create the connections for each of these databases. When ...

 
2:23 PM
0
Q: http get NodeJS how to get error status code?

user3647766OK, I must be dense since I cannot find anywhere how to get the error status codes when using Node.JS http.get or http.request. My code: var deferred = $q.defer(); var req = https.get(options, function(response){ var str = ''; response.on('data', function (chunk) { ...

 
2:35 PM
0
Q: FInd and Count in mongoose

prismdb.hiren.find({ 'tag' : "example" }).count(); How to execute similar statement in mongoose ? I just want to find and count the tag in same time .

 
3:12 PM
0
Q: Bluebird promisify on function with return value

user605331I'd like to use Bluebird's promisify function on an AWS putItem function. Notice from the docs that it returns an AWS.Request object. I am not interested in that object and ideally I would just call db.putItem({...}); and get a Promise back. Is this possible? When I tried it, the promisify'd ...

 
3:30 PM
0
Q: Does Mongoose $pop remove the element immediately or only after save?

Dan MandleFrom these docs: http://mongoosejs.com/docs/api.html#types_array_MongooseArray-%24pop If I were to call var popped = doc.array.$pop();, does Mongoose remove that value immediately from the database document or only after save? If I had several connections that each called $pop(), would they eac...

 
3:50 PM
0
Q: npm install redis problems

PhilMDevHaving problems running npm install redis. Got error: npm WARN install Refusing to install redis as a dependency of itself When I tried to install hiredis it would appear to install just fine however, when I tried to run any of the examples they would fail with the required file "redis" not f...

0
Q: socketIO and Expressjs v4

tommyd456I'm running a MEAN stack with Expressjs v3. Got it linked up to socketIO too no problem but I thought I would give Expressjs v4 a whirl. I have everything working except for a page that receives the real-time updates via socketIO. I'm getting an error in the Chrome console saying io is not define...

0
Q: Node.js http-server and a rewrite rule

linsenfipsI'm using the node.js module http-server for developing an AngularJS application. Now I want to add a rewrite rule for this server: Every request with the pattern: http://localhost:8000/api/* should be redirected to http://apiserver/api/* All other request should be handled by http-serve...

 
4:15 PM
-2
Q: Как лучше организовать обмен данными по сокетам между пользователями?

user3647991Добрый день. Я не буду описывать реальную ситуацию, т.к. она довольно непроста, попробую рассказать суть, которой хочется добиться и собственно услышать ваши мнения по этому вопросу. Итак, представьте ситуацию: есть игра, в которой игроки подключаются к комнате и ждут ее начала. Когда игра нач...

0
Q: restart node.js forever process if response time too big

efrI got forever script for managing node.js site. Sometimes node.js site hangs and response time go above 30 seconds. And in fact site is down. Then fast cure for it is restarting forever: $ forever restart 3 where 3 is script number in forever list. Is it possible to make it automatically? ...

0
Q: Mongodb + nodejs mongoskin update not working

LinkandzeldaI'm having issues updating a doc through Node + Express and Mongodb via Mongoskin. I used the following via the mongo command line and it works as expected: db.userlist.update({_id: ObjectId('5377821219f21e974150bacf')}, {$set: {username: "Test"}}) However doing the similar line within Node do...

0
Q: NodeJS / Typescript / grunt development workflow

user3647994I'm currently trying to setup a good and efficient dev environment using NodeJS and typescript and Grunt. I thought about the following project structure: MyProject client lib index.html server routes app.ts Now i want to use Grunt for live compilation of my *.ts files. The problem is t...

0
Q: Jade indentation inconsistency, Express and Node.js Tools for Visual Studio

GeoywsExpress creates files index.jade, layout.jade and error.jade with 2 spaces for indentation, whereas Visual Studio's default indentations are 4 spaces wide. Hrm. Well. I'm sure there are those who prefer 2 spaces, and those who prefer 4. So why don't they allow for settings?

0
Q: How to Prevent Websocket Hack when sending from Server to Client in NodeJS?

1ManStartupHello i'm currently building a messaging system with Websockets(Engine.IO). And i'm afraid I may be exposing myself to a client side hack. What I am doing is filtering the incoming message/data on client side, as "private" or "public", my code is the following: How can I prevent user from gettin...

0
Q: How to pass or access values between Node.js modules

user1071460I'm writing a small Node app that require authentication. I have the Node Express app.js and it includes auth.js and user.js like this: var mongo = require('mongoskin'); var db = mongo.db("mongodb://localhost:27017/ntp01", {native_parser:true}); var auth = require('./lib/auth'); var routes = ...

0
Q: Express.js - what goes inside Adapters folder in express framework

user3648035What is adapters folders used for in express framework structure? any explanation on adapters itself will also help -thanks in advance.

0
Q: Set default winston logger for all modules

lostintranslationI am trying to setup winston to work in all my modules in the same fashion as in here: using winston in several modules But I am running in problems. I have setup a logger.js file to configure the console logger: var winston = require('winston'); var logger = new (winston.Logger)({ transpo...

 
4:56 PM
0
Q: heroku Idle connection timeout on heroku socket.io server based

JurgoSometimes my socket server raise the following problem: Here the heroku log: heroku[router]: at=error code=H15 desc="Idle connection" method=GET path=/socket.io/1/websocket/RcjG0Zjot1U3uwLWX9SI host=www.*********.** request_id=69f5aa39-255b-4871-a928-1548ef2fdd4f fwd="217.200.201.210" dyno=web....

 
woo, lots of questions to answer
 
heh yea
I keep seeing them flow in
I figured the room would be frozen by now
 
Yep. doesn't get enough attention on main, so I thought it'd be good to have a room to find questions and highlight good answers.
I think @RUJordan would appreciate this room
 
5:15 PM
0
Q: Why is CreateServer being called twice?

Tony EnnisI installed node.js today. I started with the example "Hello World" server and started hacking on it. Before long, I had this: var http = require('http'); var count = 0; http.createServer(function handler(req, res) { console.log('yeah ' + count++); res.writeHead(200, {'Content-Type': 't...

0
Q: how to get logged in user inside model for mongoose virtual attribute

chovyI'm trying to define a virtual attribute called 'perms' on a JobSchema. JobSchema.virtual('perms').get(function(){ var perms = {} , userId = user._id , userRole = user.role , hasModify = userRole === 'admin' || this.creator && userId.id == this.creator.id; perms....

 
5:33 PM
0
Q: CORS with express/nodejs and cordova?

Michael Joseph AubryI have an express app that I am converting into a cordova app, I thought it would be easy but since the server renders my express handlebars templates this has required me to do some cross domain stuff with ajax. The original app is a login based app with passportjs. I am able to render the inde...

0
Q: Partials not working with Express 4 and JUST

Adrian BartholomewI migrated to JUST from EJS because EJS moved from partials to includes which do not accept passed data. I have the JUST template working but it throws an error whenever it tries to find a partial file. Error: ENOENT, open 'list' My App code: var path = require('path'); var express ...

0
Q: Using AngularJs $resource object for parameterized searches

user3648126I am developing my first application based on the MEAN stack and I am having problems retrieving data using api calls. How do I modify my AngularJS $resource and controller code below to allow me to return: a single record in the collection all records in the collection all records matching a ...

 
6:36 PM
0
Q: Node.js and WinLess are not showing error messages, Do i need to put Less.js In Developer mode?

battletoiletI have downloaded and installed node.js and less.js using npm but when i compile my less files, using node.js command line (Using the following Command) lessc -x style.less ../css/style.css less.js does not report any errors, it returns successful but, my css file remains unchanged, and the da...

 
6:54 PM
0
Q: Meteor Twilio MRT package

jawad-ukQuick question (I hope) - I'm trying to use the Meteor Twilio package ("mrt add twilio") to send SMSs from my app. Everything is set up correctly (and I pre-installed Moment as mentioned in the docs), I think... however I'm getting a "Twilio is not defined" error when my code is run in the even...

0
Q: Processing audio streams from WebRTC peer connections on server

jpenI am working on an experimental peer-to-server WebRTC project, in which clients (Chrome) send their local audio stream to a remote server the remote server records that audio stream into a file for later processing the server makes that particular file available for the client who sent it to li...

 
7:16 PM
0
Q: Grunt+jshint: .jshintrc not having any effect

IcarusI am getting ES6 related errors for my server side code from jshint, in my node project. I am in fact using ES6, but on the server side only. So I want to disable ES6 related errors server side, but not client side. For this jshint provides the esnext option: http://jshint.com/docs/options/#esn...

 
7:53 PM
0
Q: Unable to match this string "18% on $25.56" with this regex ".*(\d+)%.*\$(\d+)(\.\d+)?$". What am I doing wrong?

devcoderI'm trying to get the numbers out of a string that user inputs for calculating tip. The query could be "Calculate 18% tip on $25.56" or simply "18% $25.56" I've built up this regex .*(\d+)%.*\$(\d+)(\.\d+)?$ However, the first capturing group doesn't capture 18, just 8. What am I doing wron...

0
Q: Node.js website hosted in Azure Web Sites returning error

DanteI have a node.js website hosted in Azure Web Sites. This website was running properly but after pushing a change to a file (small html change) the site is not running anymore. I get the error "The resource you are looking for has been removed, had its name changed, or is temporarily unavailable....

0
Q: How to Load and Play A Song Using Web Audio API?

user2316667All the tutorials that I found online pertain to short sounds aproximately 5seconds long that can be sent in one response, but what about longer songs that need to be streamed? I'm using google chrome as the client and nodejs as the server. The code below is what I pieced together. If you open ...

 
 
1 hour later…
9:06 PM
Working on ruleset for room
 
0
Q: NodeJs Method Chaining of fs.mkdir and fs.rename

Steve MusterI'm working on a file uploader script which creates a new folder (based on the timestamp) and moves the uploaded file to the created folder. Sometimes it is working and sometimes I'm getting a ENOENT rename Error (file/folder not exist). var form = new multiparty.Form({ uploadDir: tempPath }...

 
9:39 PM
0
Q: Logging into an expressjs app with CORS

Michael Joseph AubryI have expressjs sitting on a nodejs server and I have a client side cordova app making ajax requests to certain routes. This is fine until I need to make a POST request to login using passportjs, there is a 302 redirect that takes place so I get this 302 Moved Temporarily when making this call ...

 
0
A: Logging into an expressjs app with CORS

SomeKittens Ux2666CORS is not your problem here. Passport wants to redirect your user (based on the values you've passed to passport.authenticate). For instance: app.get('/auth/facebook/callback', passport.authenticate('facebook', { successRedirect: '/', failureRedirect: ...

 
9:54 PM
0
Q: Node.js HMAC256 functions not working in javascript

Jonathanfunction cyptography() { alert("cryptography"); var http = require('http'); alert(http); var crypto = require('crypto'); alert(crypto); var signer = crypto.createHmac('sha256', new Buffer(<client ID>, 'utf8')); alert(signer); var result = signer.update(<signature ID>...

 
10:06 PM
0
Q: yeoman permission issue with nodejs and angular

Eduardo DennisI am trying to start an angular web app with yeoman but I get permission issue when trying to install the new generator. I can bypass and install generator with sudo but then I get the permission errors when running **yo** angular I deduce its because its trying to access npm modules that are...

 
10:30 PM
0
Q: Switch versions of node.js packages

juanpastasI installed two different versions of a node package: npm install sails -g npm install sails@beta -g What could I use to use these versions according what is specified in package.json in a directory basis?

0
Q: CORS Logging into an expressjs/passportjs app 401 Unauthorized

Michael Joseph AubryI am converting a web app into a cordova app the only thing stopping me is the fact that the app is expressjs based, since cordova requires an index.html I need to use CORS to render the app and provide the login session. I can use ajax/CORS with regular pages but when it comes to authorization ...

 
10:51 PM
0
Q: Adding custom properties to Express app and req. What's the best way?

Michael ColeAm I shooting myself in the foot: I want to make config, core, and mean available on the app and req objects in my Express app. I'm using properties not in the 4.x API. Anything I should know? Is there a problem with just adding them as properties? // express.js module.exports = function(d...

 
11:26 PM
0
Q: How to parse the PHPSESSID cookie in socket.io?

user784637How do I determine if the PHPSESSID cookie is set and how do I get its value? app.js var server = require('http').createServer(app) , io = require('socket.io').listen(server); server.listen(80); io.sockets.on('connection', function (socket) { socket.on('print cookies', function (data) { ...

0
Q: JavaScript Synchronous Loops

IndoleringI've been hitting my head on JavaScript's Async behavior when scaling functions from my test data to production work. I have a for loop that I know will range in the hundreds of thousands, will Node pause a for loop and come back to it or can I safely assume that Node will execute the loop to co...

0
Q: nodejs - through package - make requests synchronous

SourabhI was doing nodeschool's stream-adventure - 6 and this is my code (question here): var capitalize = through(function (chunk) { this.queue(chunk.toString().toUpperCase() + '\n') }) var server = http.createServer(function (request, response) { request.pipe(capitalize).pipe(response) }) ...

0
Q: Darkcoin nomp pool payment processing error and missing ui

BENZ.404We are setting up nomp https://github.com/zone117x/node-open-mining-portal When we run node init.js This happens: root@drk:~/node-open-mining-portal# node init.js 2014-05-17 18:51:17 [POSIX] [Connection Limit] (Safe to ignore) POSIX module not installed and resource (connection) limit w...

 
11:53 PM
0
Q: Passport/nodejs req.user undefined when logging in via CORS

Michael Joseph AubrySo logging in to an expressjs/passportjs app via CORS I am a bit confused. On the server side I handle the authentication route like this app.post('/login', passport.authenticate('local-login'), function(req, res) { res.send(req.user) }); The POST is made with ajax and the response DOES...

0
Q: Pushing an array returns Object object

MelgoVI Have collecion called "capacitaciones", one of it's attributes is an array called "comentarios" I have a problem when I am pushing it, my code returns [Object object], I want you see my model and then my controller: Model module.exports = { attributes: { title:{ type:'STRING', ...

0
Q: req.form is not an instantiated multiparty Form Object

Will SchoenbergerI'm using express node framework with multipart middleware. Setting the multipart defer: true option gets me access to req.form in the route but it does not seem to be a valid instantiation of the multiparty Form Object. It's just a plain old JS Object. The issue is that I cannot use the feature...

 

« first day    last day (77 days later) »