<?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>node.js | Nerdpress.org</title>
	<atom:link href="https://nerdpress.org/category/js/node-js/feed/" rel="self" type="application/rss+xml" />
	<link>https://nerdpress.org</link>
	<description>...dev, tech problems and solutions.</description>
	<lastBuildDate>Fri, 12 Apr 2024 08:01:50 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.5</generator>
	<item>
		<title>Monorepo with NPM workspaces</title>
		<link>https://nerdpress.org/2024/04/12/monorepo-with-npm-workspaces/</link>
		
		<dc:creator><![CDATA[Ivo Bathke]]></dc:creator>
		<pubDate>Fri, 12 Apr 2024 08:01:50 +0000</pubDate>
				<category><![CDATA[JS]]></category>
		<category><![CDATA[node.js]]></category>
		<category><![CDATA[NPM]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Monorepo]]></category>
		<category><![CDATA[nodejs]]></category>
		<guid isPermaLink="false">https://nerdpress.org/?p=3300</guid>

					<description><![CDATA[<p>I recently converted a project into a Monorepo.I had a cli part and an Astro StaticSiteGenerator part. At some point I felt like these parts would be entangled too much so I decided to separate them. Since they were still related they should stay in one repo but have their own dependencies and separate processes. &#8230; </p>
<p class="link-more"><a href="https://nerdpress.org/2024/04/12/monorepo-with-npm-workspaces/" class="more-link">Continue reading<span class="screen-reader-text"> "Monorepo with NPM workspaces"</span></a></p>
The post <a href="https://nerdpress.org/2024/04/12/monorepo-with-npm-workspaces/">Monorepo with NPM workspaces</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></description>
										<content:encoded><![CDATA[<p>I recently converted a project into a Monorepo.<br />I had a cli part and an Astro StaticSiteGenerator part. <br />At some point I felt like these parts would be entangled too much so I decided to separate them. Since they were still related they should stay in one repo but have their own dependencies and separate processes. I still could have kept this in one Astro project with a cli folder but so it feels cleaner structured.</p>



<p>I chose NPM as my package manager since it comes bundled with node and so I decided to try out <a href="https://docs.npmjs.com/cli/v7/using-npm/workspaces" title="">NPM workspaces</a> as my MonoRepo approach.</p>



<p>So here are my takeaways</p>



<span id="more-3300"></span>



<p><strong>1.  Setup</strong></p>



<ul class="wp-block-list">
<li>The NPM workspaces Monorepo has one root dir with one package.json which defines the workspaces, but besides this it is more or less empty. The package.json defines a workspace directory which contains the sub projects. <br />As of now you can&#8217;t use <code>npm init</code> for this but have to create the main package.json manually.</li>
</ul>


<pre class="wp-block-code"><span><code class="hljs language-javascript">  <span class="hljs-string">"name"</span>: <span class="hljs-string">"workspaces-example"</span>,
  <span class="hljs-string">"workspaces"</span>: &#91;
    <span class="hljs-string">"packages/*"</span>
  ],</code></span></pre>


<figure class="wp-block-image size-full"><a href="https://nerdpress.org/wp-content/uploads/2024/04/npm-workspaces-directories.png"><img fetchpriority="high" decoding="async" width="258" height="210" src="https://nerdpress.org/wp-content/uploads/2024/04/npm-workspaces-directories.png" alt="" class="wp-image-3303"/></a></figure>



<ul class="wp-block-list">
<li>The sub projects each have their own package.json with all necessary dependencies for this specific project. The sub projects can be initialised by <code>npm init -w packages/cli</code></li>



<li>To add dependencies you can add the workspace to the <code>npm add</code> command and the dependency will be added to the respective package.json:<br /><code>npm add commander -w packages/cli</code><br />To install dependencies, run <code>npm i</code> from the root directory. This will install all deps of all workspaces in a node_modules folder in the root directory, but none in the projects in the workspaces folder. This already is a win because it will avoid having dependency duplettes.<br />However if you have conflicting versions of the same dependency in your packages, you will have a separate node_modules directory with the only the specific version for this single package.</li>
</ul>



<figure class="wp-block-image size-full"><a href="https://nerdpress.org/wp-content/uploads/2024/04/npm-workspaces-conflicting-versions-directories-1.png"><img decoding="async" width="272" height="354" src="https://nerdpress.org/wp-content/uploads/2024/04/npm-workspaces-conflicting-versions-directories-1.png" alt="" class="wp-image-3306" srcset="https://nerdpress.org/wp-content/uploads/2024/04/npm-workspaces-conflicting-versions-directories-1.png 272w, https://nerdpress.org/wp-content/uploads/2024/04/npm-workspaces-conflicting-versions-directories-1-231x300.png 231w" sizes="(max-width: 272px) 100vw, 272px" /></a></figure>



<p><br /><strong>2. Development</strong></p>



<ul class="wp-block-list">
<li>Updating dependencies can happen just like adding dependencies:<br /><kbd>npm update commander -w packages/cli</kbd></li>



<li>When you need different versions of a dependency in your workspaces, NPM will create a new node_modules folder in the one divergating workspace with only the dependency where you have the different version.</li>



<li>When you need to share code between workspaces you can import code from one package of the workspaces in another package just as a normal dependency from the NPM registry. <br />For example when you want to share types in a typescript project you can add a types workspace and just import in the other workspaces files. <br /><code>import {Name} from "types";</code></li>



<li>It is probably good practice to add shortcut scripts to your main package.json to run commands of your workspaces. So you don&#8217;t need to change to the workspaces directory, which is of course still possible.</li>
</ul>


<pre class="wp-block-code"><span><code class="hljs language-javascript">  <span class="hljs-string">"scripts"</span>: {
    <span class="hljs-string">"hello-cli"</span>: <span class="hljs-string">"npm --workspace=@workspaces-example/cli run hello"</span>,
    <span class="hljs-string">"hello-web"</span>: <span class="hljs-string">"npm --workspace=@workspaces-example/web run hello"</span>
  }
</code></span></pre>


<p><strong>3. Deploy</strong></p>



<ul class="wp-block-list">
<li>Deploying from a Monrepo needs to take the different packages into account, which need to be deployed separately but from the same CI config. <br />For Github Actions i used a path directive which changes to the package directory and runs instructions there. <br /><code>with: <br />  path: packages/astro</code></li>



<li>Other prefabricated actions like f.e. <kbd>actions/deploy-pages</kbd> have a <br /><kbd>working-directory: ./packages/astro</kbd> <br />directive which have the same effect.</li>
</ul>



<p>You can check out the example project here: <a href="https://github.com/ivoba/npm-workspaces-example" target="_blank" rel="noopener" title="">https://github.com/ivoba/npm-workspaces-example</a></p>



<p>One probably does not necessarily need a Monorepo for this example, but it is good to know that Monorepos are quite simple to achieve just with NPM, in case you need to.</p>The post <a href="https://nerdpress.org/2024/04/12/monorepo-with-npm-workspaces/">Monorepo with NPM workspaces</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>mashcloud.net &#8211; mashup soundcloud audio tracks</title>
		<link>https://nerdpress.org/2013/01/24/mashcloud-net-mashup-soundcloud-audio-tracks/</link>
		
		<dc:creator><![CDATA[Max Girkens]]></dc:creator>
		<pubDate>Thu, 24 Jan 2013 20:08:28 +0000</pubDate>
				<category><![CDATA[API]]></category>
		<category><![CDATA[Express]]></category>
		<category><![CDATA[Frontend]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[JS]]></category>
		<category><![CDATA[node.js]]></category>
		<category><![CDATA[socket.io]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[sockets]]></category>
		<category><![CDATA[soundcloud]]></category>
		<guid isPermaLink="false">https://nerdpress.org/?p=2359</guid>

					<description><![CDATA[<p>mashcloud.net is an experiment on collaborative realtime audio editing and music creation. I did the project within the frame of  my BA thesis in audio production last year. As I moved the code to github this week, I wanted to give a quick overview of the project and its technical underlyings, just in case someone might &#8230; </p>
<p class="link-more"><a href="https://nerdpress.org/2013/01/24/mashcloud-net-mashup-soundcloud-audio-tracks/" class="more-link">Continue reading<span class="screen-reader-text"> "mashcloud.net &#8211; mashup soundcloud audio tracks"</span></a></p>
The post <a href="https://nerdpress.org/2013/01/24/mashcloud-net-mashup-soundcloud-audio-tracks/">mashcloud.net – mashup soundcloud audio tracks</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></description>
										<content:encoded><![CDATA[<p><a href="http://mashcloud.net/">mashcloud.net</a> is an experiment on collaborative realtime audio editing and music creation. <br />I did the project within the frame of  my BA thesis in audio production last year.</p>
<p>As I moved the code to <a href="https://github.com/gherkins/mashcloud">github</a> this week, I wanted to give a quick overview of the project and its technical underlyings, just in case someone might be interested :)</p>
<p><span id="more-2359"></span>As the title of this post might already suggest, its about selecting and layering loops from audiofiles hosted on <a href="http://soundcloud.com">soundcloud.com</a> and thereby creating new music.</p>
<p><a href="https://nerdpress.org/2013/01/24/mashcloud-net-mashup-soundcloud-audio-tracks/bildschirmfoto-2013-01-24-um-20-46-08/" rel="attachment wp-att-2363"><img decoding="async" class="alignnone size-medium wp-image-2363" alt="Bildschirmfoto 2013-01-24 um 20.46.08" src="https://nerdpress.org/wp-content/uploads/2013/01/Bildschirmfoto-2013-01-24-um-20.46.08-300x174.png" width="300" height="174" srcset="https://nerdpress.org/wp-content/uploads/2013/01/Bildschirmfoto-2013-01-24-um-20.46.08-300x174.png 300w, https://nerdpress.org/wp-content/uploads/2013/01/Bildschirmfoto-2013-01-24-um-20.46.08-1024x593.png 1024w, https://nerdpress.org/wp-content/uploads/2013/01/Bildschirmfoto-2013-01-24-um-20.46.08.png 1050w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>Those collections of layered loops are called a session. Sessions can be created anonymously by everyone and are auto-saved on every action. By distributing the URL of a session other users can join and every action is synced between all users in realtime. <br />(complete mayhem, indeed :)</p>
<p>The application is built with HTML5 and JS w/ <a href="http://jquery.com/">jQuery</a> using the <a href="http://developers.soundcloud.com/docs/api/guide">soundcloud API</a> on the client side and runs on <a href="http://nodejs.org/">node.js</a> &amp; <a href="http://www.mongodb.org/">mongoDB</a> with <a href="http://expressjs.com/">express</a>, <a href="http://socket.io/">socket.io</a> and <a href="http://mongoosejs.com/">mongoose</a> on the server side.</p>
<p>I basically started the project to find out if you could play multiple loops asynchronous and synced with low latency using the <a href="https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html">Web Audio API</a> while collaboratively working together with multiple users in realtime. </p>
<p>As that turned out to be not only possible but performed real nicely, the experiment then developed in somewhat of an application and finally got a name and a face.</p>
<p>There&#8217;s a whole lot of things i&#8217;d like to implement / refactor and do when i get some time on my hands, as</p>
<p>&#8211; adding a &#8220;record&#8221; feature to record, save and export created sessions as audiofiles</p>
<p>&#8211; rewriting the client side with <a href="http://backbonejs.org/">backbone.js</a> (as things got a bit messy &#8230;)</p>
<p>&#8211; adding some audio effects to the tracks</p>
<p>&#8211; write some tests</p>
<p>I&#8217;d appreciate any form of contribution as much as any questions or feedback on the project :)</p>
<p>Feel free to check out the live version at <a href="http://mashcloud.net/"> http://mashcloud.net/</a> or the sources at <a href="https://github.com/gherkins/mashcloud">https://github.com/gherkins/mashcloud</a></p>The post <a href="https://nerdpress.org/2013/01/24/mashcloud-net-mashup-soundcloud-audio-tracks/">mashcloud.net – mashup soundcloud audio tracks</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Hosting multiple Express (node.js) apps on port 80</title>
		<link>https://nerdpress.org/2012/04/20/hosting-multiple-express-node-js-apps-on-port-80/</link>
					<comments>https://nerdpress.org/2012/04/20/hosting-multiple-express-node-js-apps-on-port-80/#comments</comments>
		
		<dc:creator><![CDATA[Max Girkens]]></dc:creator>
		<pubDate>Fri, 20 Apr 2012 03:40:31 +0000</pubDate>
				<category><![CDATA[Admin]]></category>
		<category><![CDATA[Express]]></category>
		<category><![CDATA[node.js]]></category>
		<category><![CDATA[socket.io]]></category>
		<category><![CDATA[vServer]]></category>
		<category><![CDATA[express]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[proxy]]></category>
		<category><![CDATA[sockets]]></category>
		<guid isPermaLink="false">https://nerdpress.org/?p=2144</guid>

					<description><![CDATA[<p>In the last days, i was trying to find a solution hosting multiple Express apps on my vServer the same Server. Starting with Apache and mod_proxy, i ended up with a plain node solution, which i really like. Let&#8217;s take a quick look on some different approaches out there: &#8212;1&#8212; Using apache on port 80 &#8230; </p>
<p class="link-more"><a href="https://nerdpress.org/2012/04/20/hosting-multiple-express-node-js-apps-on-port-80/" class="more-link">Continue reading<span class="screen-reader-text"> "Hosting multiple Express (node.js) apps on port 80"</span></a></p>
The post <a href="https://nerdpress.org/2012/04/20/hosting-multiple-express-node-js-apps-on-port-80/">Hosting multiple Express (node.js) apps on port 80</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></description>
										<content:encoded><![CDATA[<p>In the last days, i was trying to find a solution hosting multiple <a href="http://expressjs.com/">Express</a> apps on <del datetime="2012-04-19T00:40:35+00:00">my vServer </del>the same Server.</p>
<p>Starting with <a href="http://www.apache.org/">Apache</a> and <a href="http://httpd.apache.org/docs/2.0/mod/mod_proxy.html">mod_proxy</a>, i ended up with a plain node solution, which i really like.<span id="more-2144"></span></p>
<p><a href="https://nerdpress.org/wp-content/uploads/2012/04/node-http-proxy-haz-colors.png"><img decoding="async" class="alignnone size-full wp-image-2146" title="node-http-proxy-haz-colors" src="https://nerdpress.org/wp-content/uploads/2012/04/node-http-proxy-haz-colors.png" alt="" width="527" height="106" srcset="https://nerdpress.org/wp-content/uploads/2012/04/node-http-proxy-haz-colors.png 527w, https://nerdpress.org/wp-content/uploads/2012/04/node-http-proxy-haz-colors-300x60.png 300w" sizes="(max-width: 527px) 100vw, 527px" /></a></p>
<p>Let&#8217;s take a quick look on some different approaches out there:</p>
<p><strong>&#8212;1&#8212;</strong></p>
<p>Using apache on port 80 as a proxy</p>
<pre class="brush: bash; title: ; notranslate">
ProxyPass /nodeurls/ http://localhost:9000/
ProxyPassReverse /nodeurls/ http://localhost:9000/
</pre>
<p>via <a href="http://stackoverflow.com/questions/6109089/how-do-i-run-node-js-on-port-80">stackoverflow</a></p>
<p>&#8212; no websockets<br />
++ probably the easiest way to integrate with your running AMPP-stack</p>
<p><strong>&#8212;2&#8212;</strong></p>
<p>Using a node.js app on port 80 as a Wrapper for other node apps.</p>
<pre class="brush: jscript; title: ; notranslate">
express.createServer()
  .use(express.vhost('hostname1.com', require('/path/to/hostname1').app)
  .use(express.vhost('hostname2.com', require('/path/to/hostname2').app)
.listen(80)
</pre>
<p>via <a href="http://stackoverflow.com/questions/9332865/how-should-i-organize-multiple-express-servers-on-the-same-system">stackoverflow</a></p>
<p>++ you can use websockets on port 80<br />
&#8212; apps crash/restart/stop globally<br />
&#8211;what about your apache or the like?</p>
<p><strong>&#8212;3&#8212;</strong></p>
<p>Using node.js with node-http-proxy on port 80</p>
<pre class="brush: jscript; title: ; notranslate">
var http = require('http')
, httpProxy = require('http-proxy');

httpProxy.createServer({
  hostnameOnly: true,
  router: {
    //web-development.cc
    'www.my-domain.com': '127.0.0.1:3001',
    'www.my-other-domain.de' : '127.0.0.1:3002'
  }
}).listen(80);

</pre>
<p>++ proxy websockets to any port<br />
&#8212; you might need to move your old web server to another port</p>
<p>The really cool thing about using node-http-proxy is its capability of proxying websockets.<br />
So you can have your apps running independtly on different ports while serving everything to the user over port 80 and use stuff like <a href="http://socket.io/">socket.io</a>.</p>
<p>Since i&#8217;m new to node.js and miles away from beeing a admin, any feedback is highly appreciated :)</p>The post <a href="https://nerdpress.org/2012/04/20/hosting-multiple-express-node-js-apps-on-port-80/">Hosting multiple Express (node.js) apps on port 80</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></content:encoded>
					
					<wfw:commentRss>https://nerdpress.org/2012/04/20/hosting-multiple-express-node-js-apps-on-port-80/feed/</wfw:commentRss>
			<slash:comments>14</slash:comments>
		
		
			</item>
		<item>
		<title>Tools for jade template development</title>
		<link>https://nerdpress.org/2012/04/09/tools-for-jade-template-development/</link>
		
		<dc:creator><![CDATA[Max Girkens]]></dc:creator>
		<pubDate>Mon, 09 Apr 2012 10:12:01 +0000</pubDate>
				<category><![CDATA[Express]]></category>
		<category><![CDATA[JS]]></category>
		<category><![CDATA[node.js]]></category>
		<category><![CDATA[express]]></category>
		<category><![CDATA[jade]]></category>
		<guid isPermaLink="false">https://nerdpress.org/?p=2132</guid>

					<description><![CDATA[<p>I recently started digging into node.js and the express framework. One thing i like about it is that it comes with the beautiful jade template engine by default. Here are some things that come real hany when you are working with jade. This one really saved my mental health in more than one case. Just &#8230; </p>
<p class="link-more"><a href="https://nerdpress.org/2012/04/09/tools-for-jade-template-development/" class="more-link">Continue reading<span class="screen-reader-text"> "Tools for jade template development"</span></a></p>
The post <a href="https://nerdpress.org/2012/04/09/tools-for-jade-template-development/">Tools for jade template development</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></description>
										<content:encoded><![CDATA[<p>I recently started digging into <a href="http://nodejs.org/">node.js</a> and the <a href="http://expressjs.com/">express framework</a>.<br />
One thing i like about it is that it comes with the beautiful <a href="http://jade-lang.com/">jade template engine</a> by default.</p>
<p>Here are some things that come real hany when you are working with jade.<span id="more-2132"></span></p>
<p>This one really saved my mental health in more than one case.<br />
Just paste your HTML and you get nice and clean jade code:</p>
<p><a href="http://html2jade.aaron-powell.com/">http://html2jade.aaron-powell.com/</a></p>
<p>If you are using Netbeans, make sure you don&#8217;t miss to install the beautifully working plugin for .jade files.</p>
<p><a href="https://github.com/lumenlunae/jade-netbeans-syntax-highlighting">https://github.com/lumenlunae/jade-netbeans-syntax-highlighting</a></p>
<p>If you are developing in PHP and want to check out jade anyway, check this out:</p>
<p><a href="https://nerdpress.org/wp-content/uploads/2012/04/php_jade.jpg"><img decoding="async" class="alignnone size-full wp-image-2135" title="php_jade" src="https://nerdpress.org/wp-content/uploads/2012/04/php_jade.jpg" alt="" width="293" height="238" /></a></p>
<p>No seriously, check THIS:</p>
<p><a href="https://github.com/everzet/jade.php">https://github.com/everzet/jade.php</a></p>The post <a href="https://nerdpress.org/2012/04/09/tools-for-jade-template-development/">Tools for jade template development</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Expeditions in the Cloud</title>
		<link>https://nerdpress.org/2011/12/17/expeditions-in-the-cloud/</link>
		
		<dc:creator><![CDATA[Ivo Bathke]]></dc:creator>
		<pubDate>Fri, 16 Dec 2011 23:23:13 +0000</pubDate>
				<category><![CDATA[node.js]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[cloud]]></category>
		<guid isPermaLink="false">https://nerdpress.org/?p=1999</guid>

					<description><![CDATA[<p>Caution: Scepticism ahead! So i&#8217;d like to share some of my experiences in the cloud since i am still trying to figure out if it its worth for me or if i am better suited with an VPS. Maybe somebody feels like feedbackin. I tried PHPFog for PHP and no.de by joyent for node.js. First i &#8230; </p>
<p class="link-more"><a href="https://nerdpress.org/2011/12/17/expeditions-in-the-cloud/" class="more-link">Continue reading<span class="screen-reader-text"> "Expeditions in the Cloud"</span></a></p>
The post <a href="https://nerdpress.org/2011/12/17/expeditions-in-the-cloud/">Expeditions in the Cloud</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></description>
										<content:encoded><![CDATA[<p>Caution: Scepticism ahead!</p>
<p>So i&#8217;d like to share some of my experiences in the cloud since i am still trying to figure out if it its worth for me or if i am better suited with an VPS.<br />
Maybe somebody feels like feedbackin.</p>
<p>I tried <a href="https://phpfog.com/">PHPFog</a> for PHP and<a href="https://no.de/"> no.de</a> by joyent for node.js.<br />
First i have to admit: yes i only tried the free models and of course they are limited and because its free you cant expect to get it all, right?<br />
Yes and thats true.</p>
<p>With PHPFog i set up an app based on symfony 1.4. After some inital problems due to some bugs on PHPFog side, i got it running.<br />
I really like to mention the kind and immediate chat support by PHPFog. It really made me feel like dealin with humans and not only machines. Big up!<br />
By then everything felt really smooth with git deploy, configurations, mysql setup etc.<br />
But i had to shut down the app again, because there are restrictions to PHP which killed the app like disabling &#8220;file_get_contents for remote URLS&#8221;, probably only in the free model. But that killed it for me at that point.<br />
So read this carefully before going to cloud: <a href="http://docs.phpfog.com/index.php/features/article/shared_vs_dedicated">http://docs.phpfog.com/index.php/features/article/shared_vs_dedicated</a><br />
I guess with dedicated hosting you get more power, sure.</p>
<p><span id="more-1999"></span>That brings me to the pricing plans, which means if you pay more you get more.<br />
That reminds me of good old shared hosting days.<br />
Of course in the cloud you get more and faster if you have to scale.<br />
Also if you have more apps you can bundle up, it can be a win, like read here: <a href="http://blog.phpfog.com/2011/12/08/but-isnt-php-fog-expensive-compared-to-vps/">http://blog.phpfog.com/2011/12/08/but-isnt-php-fog-expensive-compared-to-vps/</a><br />
Thats just fine, but if not you might be wrong there.<br />
And remember you are not in fully in control. So if you decide to checkout the Twig C extension: you cant.<br />
That also reminds me on good old shared hosting days.</p>
<p>With the node.js cloud i had similar deja vu&#8217;s:<br />
Gettin my node app running was not that easy but i made it after some approaches.<br />
Then it was cool: git deploy, npm support, console on the smartOS machine, having node on port 80, etc. That was great.</p>
<p><a href="https://nerdpress.org/wp-content/uploads/2011/12/no.de_.png"><img decoding="async" class="alignnone size-medium wp-image-2001" title="no.de" src="https://nerdpress.org/wp-content/uploads/2011/12/no.de_-300x136.png" alt="" width="300" height="136" srcset="https://nerdpress.org/wp-content/uploads/2011/12/no.de_-300x136.png 300w, https://nerdpress.org/wp-content/uploads/2011/12/no.de_.png 651w" sizes="(max-width: 300px) 100vw, 300px" /></a><br />
But then i tried my app and had to realize sockets are not really working on Chrome and Firefox, wtf?<br />
It seemed that there was an issue with an node-http-proxy, as you can read here: <a href="http://discuss.joyent.com/viewtopic.php?id=30975">http://discuss.joyent.com/viewtopic.php?id=30975</a>.<br />
So that patch wasnt patched and all you could do is waiting, just like in good old shared hosting days.<br />
Get me?</p>
<p>So what am i trying to say?<br />
I am not really sure, but my resumee is if youre not building the next tumblr resp. you are not expecting high scaling you might improve your server skills and stick to an VPS.</p>
<p>What else? I am confused about the pricing!</p>
<p>With an VPS its clear, with Heroku and thelikes it could be 60$ per month or more, or less, or what?, I dont know.<br />
So its pretty much testing, see what your app is actually consuming and decide then.</p>
<p>And remember for PaaS Services as described you rely on the grace of the admins in the cloud.</p>The post <a href="https://nerdpress.org/2011/12/17/expeditions-in-the-cloud/">Expeditions in the Cloud</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>nodejs plugin for netbeans</title>
		<link>https://nerdpress.org/2011/10/05/nodejs-plugin-for-netbeans/</link>
					<comments>https://nerdpress.org/2011/10/05/nodejs-plugin-for-netbeans/#comments</comments>
		
		<dc:creator><![CDATA[Ivo Bathke]]></dc:creator>
		<pubDate>Wed, 05 Oct 2011 05:45:49 +0000</pubDate>
				<category><![CDATA[IDE]]></category>
		<category><![CDATA[node.js]]></category>
		<category><![CDATA[Netbeans]]></category>
		<category><![CDATA[Plugin]]></category>
		<guid isPermaLink="false">https://nerdpress.org/?p=1830</guid>

					<description><![CDATA[<p>Over the weekend i looked for a plugin for node.js in netbeans and ended up tryin this one: http://timboudreau.com/blog/read/NetBeans_Tools_for_Node_js Actually its all said on the post itself: installation, features and restrictions. So go and read it. Its still a bit early stage and only runs on a nightly-build netbeans but it already has some helpful &#8230; </p>
<p class="link-more"><a href="https://nerdpress.org/2011/10/05/nodejs-plugin-for-netbeans/" class="more-link">Continue reading<span class="screen-reader-text"> "nodejs plugin for netbeans"</span></a></p>
The post <a href="https://nerdpress.org/2011/10/05/nodejs-plugin-for-netbeans/">nodejs plugin for netbeans</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></description>
										<content:encoded><![CDATA[<p>Over the weekend i looked for a plugin for node.js in netbeans and ended up tryin this one:<br />
<a href="http://timboudreau.com/blog/read/NetBeans_Tools_for_Node_js">http://timboudreau.com/blog/read/NetBeans_Tools_for_Node_js</a></p>
<p>Actually its all said on the post itself: installation, features and restrictions.<br />
So go and <a href="http://timboudreau.com/blog/read/NetBeans_Tools_for_Node_js">read it</a>.</p>
<p>Its still a bit early stage and only runs on a nightly-build netbeans but it already has some helpful features.<br />
<span id="more-1830"></span><br />
For me i just like to have a node.js icon as my project icon ;).<br />
No serious, i like the npm support, see image, especially for browsing the modules to see what is all available.<br />
<a href="https://nerdpress.org/wp-content/uploads/2011/10/nodejs_netbeans_npm.png"><img decoding="async" class="alignnone size-medium wp-image-1831" title="nodejs_netbeans_npm" src="https://nerdpress.org/wp-content/uploads/2011/10/nodejs_netbeans_npm-300x182.png" alt="" width="300" height="182" srcset="https://nerdpress.org/wp-content/uploads/2011/10/nodejs_netbeans_npm-300x182.png 300w, https://nerdpress.org/wp-content/uploads/2011/10/nodejs_netbeans_npm.png 819w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>Whats also is nice and that you have the modules in the file tree and that they show the module info.<br />
<a href="https://nerdpress.org/wp-content/uploads/2011/10/nodejs_plugin_netbeans.png"><img decoding="async" class="alignnone size-medium wp-image-1832" title="nodejs_plugin_netbeans" src="https://nerdpress.org/wp-content/uploads/2011/10/nodejs_plugin_netbeans-300x271.png" alt="" width="300" height="271" srcset="https://nerdpress.org/wp-content/uploads/2011/10/nodejs_plugin_netbeans-300x271.png 300w, https://nerdpress.org/wp-content/uploads/2011/10/nodejs_plugin_netbeans.png 336w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>A GUI for installing the modules and editing the package file i dont really need but its nice to have.<br />
Then starting the app from a button in netbeans is also nice.</p>
<p>I guess whats missing the most is code completion, maybe that will be added sometime soon.<br />
I hope so, because having code completion for node modules would be pretty cool.</p>The post <a href="https://nerdpress.org/2011/10/05/nodejs-plugin-for-netbeans/">nodejs plugin for netbeans</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></content:encoded>
					
					<wfw:commentRss>https://nerdpress.org/2011/10/05/nodejs-plugin-for-netbeans/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
			</item>
		<item>
		<title>[Symfony 2] AsseticBundle, Less CSS &#038; YUI Compressor unter OSX installieren</title>
		<link>https://nerdpress.org/2011/08/25/symfony-2-asseticbundle-less-css-yui-compressor-unter-osx-installieren/</link>
					<comments>https://nerdpress.org/2011/08/25/symfony-2-asseticbundle-less-css-yui-compressor-unter-osx-installieren/#comments</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Thu, 25 Aug 2011 16:55:02 +0000</pubDate>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[JS]]></category>
		<category><![CDATA[node.js]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Symfony]]></category>
		<category><![CDATA[Assetic]]></category>
		<category><![CDATA[filter]]></category>
		<category><![CDATA[less]]></category>
		<category><![CDATA[symfony 2]]></category>
		<category><![CDATA[Twig]]></category>
		<category><![CDATA[yui-compressor]]></category>
		<guid isPermaLink="false">https://nerdpress.org/?p=1600</guid>

					<description><![CDATA[<p>Less CSS und YUI-Compressor mit Assetic unter OSX installieren und innerhalb Symfony 2 konfigurieren.</p>
The post <a href="https://nerdpress.org/2011/08/25/symfony-2-asseticbundle-less-css-yui-compressor-unter-osx-installieren/">[Symfony 2] AsseticBundle, Less CSS & YUI Compressor unter OSX installieren</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></description>
										<content:encoded><![CDATA[<p>Das AsseticBundle ist ein Wrapper um <a href="https://github.com/kriswallsmith/assetic">Assetic</a>, ein geniales Tool, um statische Assets für Webprojekte zu verwalten. AsseticBundle ist extrem einfach zu verwenden, einfach die entsprechende Filter-Chain via yaml konfigurieren, um mehr muss man sich nicht kümmern. Natürlich allerdings müssen die zugrundeliegenden Abhängigkeiten im Vorfeld installiert sein. In unserem Falle benötigen wir den <a href="http://developer.yahoo.com/yui/compressor/">Yui-Compressor</a> als jar-File und <a href="http://lesscss.org/">Less CSS</a>. Less ist ein <a href="http://nodejs.org/">node.js</a> Modul, was bedingt, dass wir zuvor node.js installieren müssen.<br />
<span id="more-1600"></span></p>
<p>Also node.js via macports holen:</p>
<pre class="brush: bash; title: ; notranslate">
$ sudo port install nodejs
</pre>
<p>Und den node.js-eigenen Package-Manager:</p>
<pre class="brush: bash; title: ; notranslate">
$ sudo port install npm
</pre>
<p>Mit diesem installieren wir als nächsts less, und zwar &#8220;global&#8221; (via -g)-Flag (&#8220;global&#8221; bedeutet, dass das Modul unter $nodejs_lib_path/../node_modules abgelegt wird, ansonsten wird es im aktuellen Arbeitsverzeichnis unter ./node_modules installiert):</p>
<pre class="brush: bash; title: ; notranslate">
$ sudo npm install -g less
</pre>
<p>Damit haben wir alles, um unsere less CSS Stylesheets kompilieren zu können.</p>
<p>Als nächstes holen wir uns den Yui-Kompressor, diesen habe ich mir einfach aus dem Netz gezogen und unter app/java/yuicompressor-2.4.6.jar abgelegt (Die Binary findet ihr unter <a href="http://developer.yahoo.com/yui/compressor/">http://developer.yahoo.com/yui/compressor/</a>).</p>
<p>Nun die Konfiguration:</p>
<p>app/config.yml:</p>
<pre class="brush: python; title: ; notranslate">
# Assetic Configuration
assetic:
    debug:          %kernel.debug%
    use_controller: false
    filters:
        cssrewrite: ~
        less:
          node: /opt/local/bin/node
          node_paths: &#x5B;/opt/local/lib/node, /opt/local/lib/node_modules]
        yui_css:
          jar: %kernel.root_dir%/java/yuicompressor-2.4.6.jar
</pre>
<p>Zu beachten sind die &#8220;node_paths&#8221;. Der node.js-Modulpfad muss explizit angegeben werden, sonst kann node.js die require()-Statements nicht auflösen (das sind sozusagen die node.js-&#8220;Classpaths&#8221;). /opt/local/lib/node zeigt auf Core-Module, in /opt/local/lib/node_modules liegt unser less.</p>
<p>Um den Yui-Kompressor zu aktivieren, reicht der simple Pfad zur .jar-Datei.</p>
<p>Nun müssen wir nur noch unser Twig-Layout anpassen:</p>
<p>src/Nerdpress/DemoBundle/Resources/views/layout.html.twig:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;!DOCTYPE html&gt;
&lt;html&gt;
    &lt;head&gt;
        &lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
        {% stylesheets
                '@NerdpressDemoBundle/Resources/public/css/main.css'
                '@NerdpressDemoBundle/Resources/public/css/layout.css'
        	filter='less,?yui_css'
                combine=true
        %}
          &lt;link rel=&quot;stylesheet&quot; href=&quot;{{ asset_url }}&quot; type=&quot;text/css&quot; media=&quot;all&quot; /&gt;
        {% endstylesheets %}
</pre>
<p>Das &#8220;?&#8221; vor dem Filter &#8220;yui_css&#8221; bedingt, dass die CSS-Compression nur angeschaltet wird, wenn der Debug-Parameter auf false steht. &#8220;Combine&#8221; bedeutet, dass alle CSS-Dateien in einer einzigen, großen Datei zusammengefügt werden, und &#8220;less&#8221; bedeutet letztlich, dass alle CSS-Dateien mittels less CSS precompiled werden.</p>
<p>That´s it. Die Seite im Browser öffnen und das Ergebnis bewundern. Viel Spaß! Symfony ist schon was feines&#8230;</p>The post <a href="https://nerdpress.org/2011/08/25/symfony-2-asseticbundle-less-css-yui-compressor-unter-osx-installieren/">[Symfony 2] AsseticBundle, Less CSS & YUI Compressor unter OSX installieren</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></content:encoded>
					
					<wfw:commentRss>https://nerdpress.org/2011/08/25/symfony-2-asseticbundle-less-css-yui-compressor-unter-osx-installieren/feed/</wfw:commentRss>
			<slash:comments>5</slash:comments>
		
		
			</item>
		<item>
		<title>Synchronous http request in node.js, that you dont want, probably</title>
		<link>https://nerdpress.org/2011/06/28/synchronous-http-request-in-node-js-that-you-dont-want-probably/</link>
		
		<dc:creator><![CDATA[Ivo Bathke]]></dc:creator>
		<pubDate>Tue, 28 Jun 2011 10:08:37 +0000</pubDate>
				<category><![CDATA[node.js]]></category>
		<category><![CDATA[nodejs]]></category>
		<guid isPermaLink="false">https://nerdpress.org/?p=1536</guid>

					<description><![CDATA[<p>Achtung dummy code! &#8230;and so it goes Asynchronous: for(var i = 0; i &#60; loop.length; i++) { var proxy = http.createClient(PORT,SERVER); var request = proxy.request('GET', url, { &#34;host&#34;: SERVER }); request.end(); ... } fire, fire, fire, fire &#8230; and so it dont, Synchronous then: var proxy = http.createClient(PORT,SERVER); for(var i = 0; i &#60; loop.length; &#8230; </p>
<p class="link-more"><a href="https://nerdpress.org/2011/06/28/synchronous-http-request-in-node-js-that-you-dont-want-probably/" class="more-link">Continue reading<span class="screen-reader-text"> "Synchronous http request in node.js, that you dont want, probably"</span></a></p>
The post <a href="https://nerdpress.org/2011/06/28/synchronous-http-request-in-node-js-that-you-dont-want-probably/">Synchronous http request in node.js, that you dont want, probably</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></description>
										<content:encoded><![CDATA[<p>Achtung dummy code!</p>
<p>&#8230;and so it goes Asynchronous:</p>
<pre class="brush: jscript; title: ; notranslate">
 for(var i = 0; i &lt; loop.length; i++)
 {
	var proxy = http.createClient(PORT,SERVER);
	var request = proxy.request('GET', url, 
        {
            &quot;host&quot;: SERVER
        });
	request.end();
	...
 }
</pre>
<p>fire, fire, fire, fire</p>
<p>&#8230; and so it dont, Synchronous then:</p>
<pre class="brush: jscript; title: ; notranslate">
var proxy = http.createClient(PORT,SERVER);
 
for(var i = 0; i &lt; loop.length; i++)
 {
	var request = proxy.request('GET', url, 
        {
            &quot;host&quot;: SERVER
        });
	request.end();
	...
 }
</pre>
<p>point &#8211; shoot, point &#8211; shoot, point &#8211; shoot</p>
<p>well i didnt know that :)</p>The post <a href="https://nerdpress.org/2011/06/28/synchronous-http-request-in-node-js-that-you-dont-want-probably/">Synchronous http request in node.js, that you dont want, probably</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
