<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>FeedHenry &#187; Node.js</title>
	<atom:link href="http://www.feedhenry.com/tag/node-js/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.feedhenry.com</link>
	<description>Mobile Application Platform</description>
	<lastBuildDate>Thu, 16 May 2013 14:28:27 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4.2</generator>
		<item>
		<title>Unit Testing a Node.js Backend</title>
		<link>http://www.feedhenry.com/2012/08/unit-testing-a-node-js-backend/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=unit-testing-a-node-js-backend</link>
		<comments>http://www.feedhenry.com/2012/08/unit-testing-a-node-js-backend/#comments</comments>
		<pubDate>Thu, 16 Aug 2012 13:49:14 +0000</pubDate>
		<dc:creator>Cian Clarke</dc:creator>
				<category><![CDATA[Developer]]></category>
		<category><![CDATA[BaaS]]></category>
		<category><![CDATA[Cloud]]></category>
		<category><![CDATA[Node.js]]></category>
		<category><![CDATA[Unit Testing]]></category>

		<guid isPermaLink="false">http://www.feedhenry.com/?p=3179</guid>
		<description><![CDATA[Unit tests are an essential part of the lifecycle of any app development project, and today we&#8217;re going to discuss the use of cloud based unit tests. Using the FeedHenry platform as a mobile Backend as a Service (mBaaS), and writing integrations with complex systems as a series of cloud based services, is an excellent [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.feedhenry.com/wp-content/uploads/2012/08/Screen-Shot-2012-08-16-at-13.55.56.png"><img class="alignright  wp-image-3240" title="Unit Testing" src="http://www.feedhenry.com/wp-content/uploads/2012/08/Screen-Shot-2012-08-16-at-13.55.56.png" alt="" width="214" height="199" /></a>Unit tests are an essential part of the lifecycle of any app development project, and today we&#8217;re going to discuss the use of cloud based unit tests. Using the FeedHenry platform as a mobile Backend as a Service (mBaaS), and writing integrations with complex systems as a series of cloud based services, is an excellent strategy for developing a series of mobile applications with modular, re-usable integrations.</p>
<p>However, these integration points become a vital interface between your backend systems and the rest of the world. Every line of cloud logic could potentially affect hundreds of thousands of connecting mobile clients, so this code is of vital importance. For this reason, having a substantial test coverage rate is critical.</p>
<h2>Writing tests</h2>
<p>A myriad of options exist when choosing a testing framework. The frameworks vary in their delceration style (  BDD, should(), expect() and plain assert()  ), and also the reporters used to return the results (Spec, Plaintext, JSON, &#8230;). The most popular unit testing frameworks are <a href="http://visionmedia.github.com/expresso/">Expresso</a> (no longer actively maintained, but in widespread use), <a href="http://visionmedia.github.com/mocha/">Mocha</a> (superceeds Expresso), and <a href="http://vowsjs.org/">VowsJS</a>. Choice of framework depends largely on personal preference, and a train of thought exists that would suggest framework free, plain JS tests are the best approach. Whatever the choice of method, the core concept remains the same &#8211; verify that with some input, we receive an expected set of output.</p>
<p>For the purpose of this article, we&#8217;re not going to use a framework. Instead, we&#8217;re going to use the assert module, which comes with NodeJS by default, and we&#8217;re going to write a simple set of assertions that, combined with some console logging, verify our cloud code does as we expect.</p>
<h2>Coverage</h2>
<p>In a FeedHenry application, all functions that exists in the cloud/main.js file that are exported are public. For example</p>
<pre>exports.a = function(params, callback){
    return callback(null, {a: 1});
}
function b(params, callback){
    return callback(null, {b: 2});
}
exports.b = b;
function _c(params, callback){
    return callback(null, {c: 3});
}</pre>
<div> In the above example, function a and function b are exported &#8211; so these are public functions, accessible from mobile devices.<br />
As a bare minimum, these publicly exported functions should both be tested. Function _c is not exported, so doesn&#8217;t have to be tested &#8211; in fact, since it&#8217;s not available outside this file, we can&#8217;t test it.</div>
<div>In addition to testing all the exports that exist in main.js (i.e. all those available to out mobile devices), often we will have some utility modules that we might write to assist with data massaging, parsing, or integrating. Testcases should also exist for any exported functions that are a part of these modules.</div>
<div></div>
<div></div>
<h2>The Tests</h2>
<p>We create our tests in a file within cloud/test/tests.js:</p>
<pre>var main = require('../main'),
assert = require('assert');</pre>
<pre>main.findStores({ query: '' }, function(err, res){
   console.log("findStores: Running tests");
   assert.ok(!err);
   assert.ok(res);
   assert.ok(res.data);
   assert.ok(res.data.length &gt; 0);
   var data = res.data,
   aRecord = data[0];
   assert.ok(aRecord);
   assert.ok(aRecord.county);
   assert.ok(aRecord.address &amp;&amp; typeof aRecord.address === "object");
   assert.ok(aRecord.distance &amp;&amp; typeof aRecord.distance === "number");
   console.log("findStores: Tests passed OK.");
});</pre>
<p>This is a simple example which invokes the findStores function of main.js with one paramater &#8211; a query string of &#8221;, and asserts the existence of  &amp; type of a number of properties in the response data.</p>
<h2>When to run?</h2>
<p>Here&#8217;s some scenarios where running a unit test suite can &#8216;save your bacon&#8217;:</p>
<ul>
<li>Before you check in a change that modifies a file in /cloud<br />
<em>You&#8217;ll catch an error before it&#8217;s even made it into the repository, never mind into production. The code is fresh in your head &#8211; the error is easy to fix. </em></li>
<li>You receive an alert from your monitoring system saying &#8220;stuff is down&#8221;<br />
<em>Your unit test suite will serve as a quick sanity check, pinpointing the line of code where &#8216;stuff went wrong&#8217;, and should tell you if the issue is with your code, the endpoint you&#8217;re integrating with, or otherwise..</em></li>
<li>Running on a Continuos Integration box<br />
<em>A change was checked in without running the test cases, or the data returned by the endpoint we integrate with has changed &amp; we haven&#8217;t managed to handle it. Bad &#8211; but at least we&#8217;ve caught the issue before we push to production!</em></li>
</ul>
<h2>Screencast</h2>
<p>To illustrate the points made, we&#8217;re now going to write a small unit test for one of our example apps, <a href="http://github.com/feedhenry/Store-Finder">Store Finder</a>.</p>
<p><a href="https://vimeo.com/47468233/">You can view the screencast on vimeo</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.feedhenry.com/2012/08/unit-testing-a-node-js-backend/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>FeedHenry launches Mobile Application Platform on Cloud Foundry™</title>
		<link>http://www.feedhenry.com/2012/03/feedhenry-launches-mobile-application-platform-on-cloud-foundrytm/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=feedhenry-launches-mobile-application-platform-on-cloud-foundrytm</link>
		<comments>http://www.feedhenry.com/2012/03/feedhenry-launches-mobile-application-platform-on-cloud-foundrytm/#comments</comments>
		<pubDate>Tue, 06 Mar 2012 14:07:52 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Enterprise]]></category>
		<category><![CDATA[Apps]]></category>
		<category><![CDATA[Cloud Foundry]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[Mobile Application Platform]]></category>
		<category><![CDATA[Node.js]]></category>

		<guid isPermaLink="false">http://sites.feedhenry.com/corporate/?p=2170</guid>
		<description><![CDATA[FeedHenry, in partnership with Cloud Foundry, offers cross-platform mobile development solution fully integrated with a Platform-as-a-Service (PaaS) backend &#160; Boston, MA and Waterford, Ireland – March 06, 2012 – FeedHenry, (www.feedhenry.com), provider of enterprise mobility solutions for the development, deployment and management of mobile apps has just launched its Mobile Application Platform on Cloud Foundry [...]]]></description>
			<content:encoded><![CDATA[<p><em><span style="font-family: Calibri; font-size: small;">FeedHenry, in partnership with Cloud Foundry, offers cross-platform mobile development solution fully integrated with a Platform-as-a-Service (PaaS) backend<strong> </strong></span></em></p>
<p>&nbsp;</p>
<p><strong><span style="font-family: Calibri; font-size: small;">Boston, MA and Waterford, Ireland – March 06, 2012 –</span></strong> FeedHenry, (<a href="http://www.feedhenry.com/">www.feedhenry.com</a>), provider of enterprise mobility solutions for the development, deployment and management of mobile apps has just launched its Mobile Application Platform on Cloud Foundry</p>
<p>The majority of new application development is being done “mobile-first”. However, developers are building mobile frontend applications separately, and integrating with backend services manually. To leverage the benefits of PaaS for mobile applications, developers need a way to develop, deploy and scale these cross-platform applications on the PaaS in a seamless manner.</p>
<p>FeedHenry’s mobile application platform is the only cloud-based mobile application solution that allows developers to build HTML5, JavaScript and CSS apps with a fully integrated Node.js backend on Cloud Foundry.Developers can now use the FeedHenry solution to build and deploy mobile applications for many smartphones and tablets with backend functionality hosted on their CloudFoundry.com account.</p>
<p>“We are seeing a shift to mobile-first development within enterprises, which requires their PaaS solution to provide an integrated mobile development and deployment platform,” said Jerry Chen, vice president of cloud and application services at VMware. “FeedHenry’s cross-platform mobile development solution can make it easier and faster for Cloud Foundry<em><span style="font-family: Arial; font-size: x-small;">™</span></em> developers to build and deploy these applications.”</p>
<p>“Mobile apps are transforming how and where information is being consumed and how customers interact with organizations”, said Cathal McGloin, CEO, FeedHenry. “FeedHenry and VMware have partnered to bring a valuable solution that can enable developers speed of deployment, instant scalability, device and cloud independence with the ability to easily integrate to backend information.”</p>
<p>Developers can start building mobile applications today on the FeedHenry platform at <a href="https://mobilecf.feedhenry.com/">mobilecf.feedhenry.com.</a> New Cloud Foundry members can register and enter promotion code “<strong>feedhenry</strong>” while existing members gain immediate access from their account. All CloudFoundry.com developers will receive a free account on the FeedHenry platform, and have access to the FeedHenry web-based AppStudio development environment.  Cloud Foundry developers can download the <span style="color: black; font-family: Calibri;">FeedHenry Command Line tool to</span> use all of the features of the FeedHenry platform. The platform allows the use of any third party JavaScript library on the client side and any Javascript Node.js modules on the server-side.  The server-side business and integration logic is developed using JavaScript and developers can use any of the standard FeedHenry APIs for integration, caching, storage and encryption.</p>
<p>About FeedHenry</p>
<p>FeedHenry provides cloud-based Mobile Application Platform solutions that enable the development, deployment, integration and management of secure mobile apps for business. This mobile platform-as-a-service allows apps to be developed in HTML5, JavaScript, and CSS and deployed across all major mobile devices from a single code base. The node.js backend service offers a complete range of APIs designed to simplify and secure the connectivity of mobile apps to backend and third party systems. <strong> </strong></p>
<p>About Cloud Foundry</p>
<p>Cloud Foundry is an open platform as a service, providing a choice of clouds, developer frameworks and application services. Initiated by VMware, with broad industry support, Cloud Foundry makes it faster and easier to build, test, deploy and scale applications. It is an open source project and is available through a variety of public cloud instances, including CloudFoundry.com.</p>
<p><em><span style="color: black; font-family: Arial; font-size: x-small;">VMware and Cloud Foundry are registered trademarks and/or trademarks of VMware, Inc. in the United States and/or other jurisdictions. The use of the word “partner” or “partnership” does not imply a legal partnership relationship between VMware and any other company.</span></em></p>
<p><strong>Contacts:</strong></p>
<p><span style="font-family: Calibri; font-size: small;">FeedHenry</span><br />
<span style="font-family: Calibri; font-size: small;">Leonie Tierney</span><br />
<span style="font-family: Calibri; font-size: small;">Marketing Manager</span><br />
<span style="font-family: Calibri; font-size: small;">+1 781 799 8764</span><br />
<span style="font-family: Calibri; font-size: small;"><a href="mailto:leonie.tierney@feedhenry.com">leonie.tierney@feedhenry.com</a></span></p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.feedhenry.com/2012/03/feedhenry-launches-mobile-application-platform-on-cloud-foundrytm/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FeedHenry implements Node.js and deploys to a range of different cloud configurations.</title>
		<link>http://www.feedhenry.com/2012/01/feedhenry-implements-node-js-and-deploys-to-a-range-of-different-cloud-configurations/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=feedhenry-implements-node-js-and-deploys-to-a-range-of-different-cloud-configurations</link>
		<comments>http://www.feedhenry.com/2012/01/feedhenry-implements-node-js-and-deploys-to-a-range-of-different-cloud-configurations/#comments</comments>
		<pubDate>Tue, 10 Jan 2012 18:39:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Developer]]></category>
		<category><![CDATA[Node.js]]></category>
		<category><![CDATA[server-side]]></category>

		<guid isPermaLink="false">http://www.feedhenry.com/?p=2876</guid>
		<description><![CDATA[By Damian Beresford, Senior Software Engineer, FeedHenry Ltd. Node.js is an exciting technology that is showing rapid growth and adoption amongst developers since it’s launch in 2009. As the first JavaScript environment specifically designed for server-side execution, Node offers FeedHenry a high degree of efficiency and performance on the AppCloud server-side environment of our Mobile [...]]]></description>
			<content:encoded><![CDATA[<h3>By Damian Beresford, Senior Software Engineer, FeedHenry Ltd.</h3>
<p>Node.js is an exciting technology that is showing rapid growth and adoption amongst developers since it’s launch in 2009. As the first JavaScript environment specifically designed for server-side execution, Node offers FeedHenry a high degree of efficiency and performance on the AppCloud server-side environment of our Mobile Application Platform. Possibly the most obvious benefit is the design of asynchronous input/output, where code can process other tasks whilst waiting for an operation to complete, rather than being blocked awaiting completion. This creates a highly efficient and responsive server-side when it comes to building sophisticated mobile apps that require integration with backend systems. For a company like FeedHenry that targets enterprise clients with a complete mobile application solution, Node is the right fit in achieving the level of flexibility and scalability required by enterprise apps.</p>
<p>Equally important is the active Node.js developer community looking to integrate Node to all forms of external environments Node offers a great open source framework for any form of web-based application development and, as such, appeals to sophisticated developers looking for better tools to create real-time high-performance apps.</p>
<p>FeedHenry has had client-side and server-side scripting since it launched its cloud-based Mobile Application Platform in 2008. The client-side is a HTML5, JavaScript, CSS development environment supporting cross-platform deployment by means of wrapping native mobile device functionality while we use Node.js to support integrated mobile apps for our corporate customer base.</p>
<p>So, what about the cloud and hosting? As part of our Node.js strategy FeedHenry supports a range of Node.js hosting environments, one of which being Cloud Foundry. We have tested the deployment of server-side Node.js code directly to the public CloudFoundry.com service, managed by VMware, and also to private installations of Cloud Foundry. Additionally we deployed to the Micro Cloud Foundry instance, a freely distributed virtual machine (VM) designed for development and testing purposes. FeedHenry contributed a Node.js library version of the CloudFoundry VMC gem (https://github.com/feedhenry/vmcjs) to make this type of integration task easier for others also using Node.js. Cloud Foundry is positioning itself as one of the most comprehensive server-side hosting environments available, with a wide range of programming paradigms supported, including Java Spring, Node.js, Ruby both Rails and Sinatra, and other JVM languages/frameworks including Groovy, Grails and Scala. Cloud Foundry also offers MySQL, Redis, and MongoDB data services, as well as RabbitMQ messaging service.</p>
<p>Tapping into the recent trends in flexible virtualization, FeedHenry will also allow Enterprise customers to export their server side application as a Virtual Appliance using the industry standard OVF format (http://www.dmtf.org/standards/ovf). This allows customers to quickly deploy their server side code in any private/hybrid cloud that supports the OVF format, e.g. VMWare, Oracle VM, RedHat, VirtualBox. This should ease the administrative overhead for deployment of a private/public hybrid cloud, with the private part being a OVF image hosted inside an enterprise’s own firewall. Choosing the open standard for virtualization enables maximum compatibility with enterprise VM environments.</p>
<p>Developing scalable and high performance integrated apps is not trivial but these are qualities increasingly sought after as enterprise apps become more sophisticated and integrate on a number of different levels. While Node.js may not be the solution for everyone, it is pivotal for a platform provider like FeedHenry, where we can vastly improve the efficiency, performance, and scalability of backend or server-side application integration. FeedHenry will soon launch the Node.js environment for all our customers in the three primary public cloud clusters – the North American enterprise cluster; the European enterprise cluster; and the European freemium developer cluster, where developers can sign up for a free account.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.feedhenry.com/2012/01/feedhenry-implements-node-js-and-deploys-to-a-range-of-different-cloud-configurations/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
