I am developing an nodejs search application for itunes-search and searching some software information from my local database with express framework. The search module returns information like software name, music name through a single json variable. But now I also need Music artist details/ Software company name through another different json variable. I can simply return the song details with the bellowed code. In client sides:
$scope.search_music_data = function(data)
{
var data="Hamdoon Soft";//Search my favourite artist name or band name
$http({'method' : 'post', url: '/search', data: {'search_item' : data}}).
success(function(data){
$scope.artist_name = data;
}).
error(function(data){
})
$scope.check = true;
}
Bellowed codes are in server sides:
In route.js
app.post('/search', search.search_music);
In search_music function currently this code is working:
ItemName="calculated data Json Data"
var response.send(ItemName);
But I also need send another calculated data like
ItemName="calculated data Json Data"
ArtistName="calculated data Json Data"
var response.send(ItemName, ArtistName);
Or ItemName="calculated data Json Data" SoftWareCompnayName="calculated data Json Data" var response.send(ItemName, SoftWareCompnayName); Is it possible?I will really appreciate him/her if he/she can help me.
It is used for server-side programming, and primarily deployed for non-blocking, event-driven servers, such as traditional web sites and back-end API services, but was originally designed with real-time, push-based architectures in mind.
In a word: no. Node. js is not a programming language. Rather, it's a runtime environment that's used to run JavaScript outside the browser.
Node. js is sometimes misunderstood by developers as a backend framework that is exclusively used to construct servers. This is not the case; Node. js can be used on the frontend as well as the backend.
Java dominates enterprise computing applications, whereas, Node. js allows you to write both client and server programs using Javascript. Considering the ease of development, Node. js is better, but from application performance and security point of view, Java is the best.
Use this in server side code. I think this will help you. This is the example of multiple value sent from server to client.
res.send({artist: artist_details, music: music_details});
In client side :
you can access it data.artist & data.music from angular controller.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With