Search Posts

Category: node.js

Multer – Node JS – Upload image AND data

Im trying to upload an image to my server using Node JS, Multer and Angular JS. The problem Im facing is no matter what I do, the “req.body” is always empty on server side. I need to send the image along with some information ( a password for instance ) but everything gets undefined when it reaches the server. The image is correctly getting uploaded nevertheless. Can someone advise how to send BOTH some data […]

Angular select does not populate options

I am trying to learn nodejs. I have a simple application where I have defined an array options in app.component.ts import { Component } from ‘@angular/core’; @Component({ selector: ‘app-root’, templateUrl: ‘./app.component.html’, styleUrls: [‘./app.component.css’] }) export class AppComponent { title = ‘app’; options = [“Option1”, “Option2″]; } and I am trying to expose the options as dropdown app.component.html <div style=”text-align:center”> <h1> {{options}}! <select name=”repeatSelect” id=”repeatSelect” ng-model=”app-root”> <option ng-repeat=”option in options” value=”{{option}}”>{{option}}</option> </select> </h1> For some reason […]

how to pass data along with files from angular controller to node server?

I am passing some data from angular.js controller in following format: data: { model: { title: ‘hello’}, files: $scope.files} I am able to get this in node.js by doing this: req.files Now I want to send one more data with existing data, so I tried doing this: data: { model: { title: ‘hello’, id:newId}, files: $scope.files} but when I did req.id. I am getting undefined. What I am doing wrong? Source: AngularJS

Deploying Node and Angular to Heroku error

I’m trying to learn how to deploy a Node and Angular app to Heroku and am getting an error. Here are the steps I’m taking Create an empty repo on GitHub. Deploy the pre-create project, which creates a new heroku app. Next, I download and copy the code that is in the pre-created project. Then I push that code up to the empty repo I created step 1. I then go back to Heroku and […]

gulpfile network issue during WebSocket handshake: Unexpected response code: 400 @ browser-sync

Facing below error while requesting .net web API post request with localhost in angular, same code is working fine with other machine at my home with different network :- WebSocket connection to ‘ws://localhost:3000/browser-sync/socket.io/?EIO=3&transport=websocket&sid=E7Doi0kt1WqvOeT2AAAB’ failed: Error during WebSocket handshake: Unexpected response code: 400 n.doOpen @ browser-sync-client.js?v=2.18.1:2 // Task to run build server for testing final app gulp.task(‘build:serve’, function () { browserSync({ server: { baseDir: “./build/” } })}) Source: AngularJS

how to list all the objects from AWS with the type?

In my AWS s3 bucket I have a folder called my-folder which having 2 files and one folder below is the structure my-folder ——newdata.pdf ——backtick.doc ——jpg ——red-rose.jpg I want to show the same way in front view for users for that I a using angularjs directive. click here based on my response value I have to change the json using aws-sdk I am fetching all the objects here is the code router.get(‘/getall’, function(req, res) { […]

Next Page »