<?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/tag/node-js/feed/" rel="self" type="application/rss+xml" />
	<link>https://nerdpress.org</link>
	<description>...dev, tech problems and solutions.</description>
	<lastBuildDate>Thu, 19 Apr 2012 00:51:41 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<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 fetchpriority="high" 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>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>
	</channel>
</rss>
