Showing posts with label NodeJs. Show all posts
Showing posts with label NodeJs. Show all posts

Thursday, June 19, 2014

KoaJs: Making the make file test, push and all that

The last couple of days I have enjoyed the speed and easy-going-flow that Node, KoaJs and Herkou gives me. It's truly blows me away and I have been tweeting stuff like:
and
But... In one regard I have lied. I told Woody Zuill (friend and role model) that I could push to production with a single command. While that was true the command (git push heroku master) did just that. Push to Heroku. But I wanted it to test my code, version it, push to GitHub and then push to Heroku. You know - all the continuous delivery stuff.

I had to look into the "scary" domain of Makefiles. Untravelled territory for me. I thought it was scary but it was just a bit weird and I actually got something nice to work.

This post described what I did - and how I redeemed my statement to Woody so that deploying to production is in fact one command (about 25 seconds).

Friday, May 23, 2014

Screencast: Installing Koa Js - a tutorial through failures

When I first started to use Koa Js I was, like many I presumed, slowed down by the fact that Koa is using features in Javascript not yet released in the current Node. Like generators for example.

When your quite new to a subject the errors that you is greeted with can be quite confusing. And the solutions are often not obvious. So I did a short screencast showing off the failures that I ran into when I tried to get started with Koa. It's a tutorial through failures, quite simple.

Tuesday, May 06, 2014

MongoDb and the "10309 Unable to create/open lock file" on Ubuntu

Ok, this was about to drive me crazy, and it seems like a lot of people have run into the same problem but sometimes my Mongo installation dies on me with an error like this:
10309 Unable to create/open lock file: /data/db/mongod.lock errno:13 Permission denied Is a mongod instance already running?, terminating
Yeah, I didn't get that either. The actual error is not hard to understand, there's some kind of permission needed on the /data/db-directory. But why? And how to fix it?

Monday, April 21, 2014

Marcus Node Bits: Deploying to Heroku (and MongoHq)

I've been doing something for real! A very simple little polling site, that actually turned out pretty ok (saved the UI but I have a friend brushing that up for me) and might be useful.
It's built with KoaJs, of course, and using MongoDb as database. Basically you can create a "question", tag it with some meta data and then send a link to a page where you can start receiving answers. And there's some very basic "export to excel"-reporting. Simple stuff. I spent maybe 3-5 hours altogether on it, in the hospital bed with my son in the bed next to me. He was pretty ok, so the concentration was not on top on either tasks for me. Bad!

This Sunday I wanted to deploy the first version of it. To Heroku. It went pretty smooth but I wanted to share my story and some problems I ran into.

Tuesday, April 08, 2014

Marcus Node Bits: Let's flex Koa Js, shall we?

The first two post of this mini-series, we picked up the basic on getting Koa Js to start as well as understand what it's build from and the concepts behind it. It's time to do something for real. Well over time, one might add. This post is all about using Koa to build different websites and web api's.

By using Koas own examples I will show you how you can use Koa for a lot of common tasks and scenarios. Let's dive right in.

Tuesday, April 01, 2014

Marcus Node Bit: Let's talk about yield and generators, shall we?

Koa Js removes need for callbacks but still have uses non-blocking code. How is that possible?

If you read the code of the last blog post you might have reported a bug or two since I was using a strange asterisk at in the getGreeting-function. Is that really valid Javascript?

And when you looked very closely you might be wondering about the "yield" right there in the middle... What kind of witchcraft is this thing anyway?

These questions and more flew threw my head when I first learned about Koa and the concepts its's built upon. In this post I will try to explain that a bit and point you to other places where they explain this much better, if you don't like my tries. This is just how I, a newbie to these concepts, have tried to wrap my head around it. Hey, let's be completely transparent and say that I have to relearn this just about everyday.

It's really not that complicated once you understood it the first time... Just like quantum mechanics...

Monday, March 31, 2014

Marcus Node bits: Let's talk about Koa for a while, shall we?

Ok, let's talk about KoaJs. Why?
Well, it's new and shiny. But that's not it.
And it's tiny and stays out of your way. But that's not it.
It's created by the awesome crew behind ExpressJs (and others). But that's not it.
It teaches me about new things. And really strange things. Like generators for example. But that's not it.

No.
The
Reason
I
really
wanted to
get your
really important fact that we would like to hold on to in the rest of the text
attention
is something
different
altogether.
This has to
Stop.

Wednesday, March 26, 2014

Setting up a complete Node development machine. From scratch. For free

I got yet another computer. To work on. But there will be slow days on airports and hotels with this baby to... So I decided to try something new; I decided to go Linux and setup a development environment for Node Js. I did not set up a goal of this being a no-cost project, it just ended up that way (with one worthy exception, in the end).

I have never used Linux before and decided to go with Ubuntu that looked like it would suit my Windows/Mac background best. It did too. It's been a pure joy to use so far.

This blog post described what I did and what obstacles I ran into on the way. It was ... not surprisingly maybe... but at least gratifyingly simple and smooth. I've tried to describe it so that you can be both a total newbie and a little bit more advance. The short version (aka TL;DR) comes first in each section and then the details. Skip what you don't want to read.

I started with a normal PC Lenovo (2.5 Ghz, 4 Gb ram) with a 64-bits Windows 8.1 Pro on it. The good news is that you don't have to care about that. Because we are building a virtual computer using VirtualBox.

This post is pretty scary very very long but the installation is quick. Downloading Ubuntu and installing it it what's takes the most time. With a good internet connection (that I do NOT have), you should be able to complete all of this in under 1 hour.
Here we go.