Showing posts with label nodejs. Show all posts
Showing posts with label nodejs. Show all posts

Tuesday, January 26, 2016

Building Next Generation Web Apps…

Here are the slides from my internal talk presented at Neudesic Office Day:

https://speakerdeck.com/jomit/building-next-generation-web-apps

Some of the code for the talk can be found at:

https://github.com/jomit/Node-Cloud

https://github.com/jomit/Node-ES6-Trials

Resources:

 

s

Sunday, December 27, 2015

Node on Raspberry Pi 2


Installing Node on the Pi

Open the Pi terminal and type the below commands. Make sure node is not installed already and your Raspberry Pi 2 is already setup and ready for installation.
  1. sudo apt-get update       (Update the Operating System)
  2. curl -sL https://deb.nodesource.com/setup | sudo bash -      (Setup node repo source)
  3. sudo apt-get install nodejs      (Install node)
  4. node  -v  or npm –version   (Verify node is installed correctly)

Create your first Node web app on the Pi

Create a new folder under /home/pi  named “nodeapps” and create a new file “app.js” in this folder.
  • nano app.js
  • Add the following code in file and save it:
    var http = require('http');
    var server = http.createServer(function (request, response) {
      response.writeHead(200, {"Content-Type": "text/plain"});
      response.end("Look ma I am running Node on my Raspberry Pi !\n");
    });
    server.listen(8080);
    console.log("Server running at http://127.0.0.1:8080/");
  • node app.js
  • Visit “http://127.0.0.1:8080” or “http://localhost:8080” in the Pi browser to see the app working. If your Raspberry Pi is connected with your network you can also view the app using the Pi’s IP Address and the port 8080.
  • Use Ctrl + C to terminate the node app.

If your terminate the node app incorrectly you might get the ‘EADDRINUSE’ error message next time cause the port 8080 will still be in use.
To resolve this you can either check for the listening event or kill all the node processes as answered
here.

Enjoy JavaScripting on Raspberry Pi…

 

Sunday, November 29, 2015

ASP.net 5 (everything you should know so far…)


ASP.net 5 is the new (and significantly redesigned) open source and cross-platform framework for building .NET web applications which can run on both .NET Framework 4.6 and .NET Core.

image

Getting Started

Tools and Terminologies

  • DNX – Short for .NET Execution Environment. It is a SDK + Runtime environment to run .net applications for Windows, Mac and Linux.
    • DNVM – .NET Version Manager
    • DNX – .NET Execution Environment
    • DNU – .NET Development Utilities

  • OWIN – Open web interface for .NET

  • WebListener – Self hosted windows-only web server for ASP.NET applications to be hosted outside of IIS.

  • Kestrel – Cross platform web server for ASP.net 5 based on libuv (the async I/O library used by Node.js)

  • Katana - OWIN implementations for Microsoft servers and frameworks.

  • OmniSharp – Makes cross platform .NET development much easier.
  • Yeoman – Scaffolding tool for modern web apps.

Additional Resources

Enjoy modern web development….

.

.

.

 

Wednesday, November 04, 2015

Trying out Docker Toolbox on Windows 10


Couple of months back docker team announced the new installer Docker Toolbox which replaced the Boot2Docker installer.

I successfully upgraded my machine to Windows 10 (after second attempt) and thought to try this out and so far I love how easy it is to install and get started.

Docker Toolbox includes the following Docker tools:

  • Docker Machine for running the docker-machine binary
  • Docker Engine for running the docker binary
  • Kitematic, the Docker GUI
  • a shell preconfigured for a Docker command-line environment
  • Oracle VM VirtualBox

(Note: If you already have Virtualbox installed make sure you have the IPv4 settings for the adapter set to obtain the IP address automatically.)

image

Docker Quickstart Terminal

image

image

 

Kitematic (Alpha)

You will need the docker hub account to signin. It allows to manage all your containers and add new ones from the hub.

image

image

 

Next step will be to add some Node goodness (Dockerizing a Node.js web app) and sprinkle the “Microservices” dust . . . Smile

Enjoy Containerization . . .

.

.

.

.

Tuesday, November 03, 2015

Resources that helped me start learning Node.js

 

 

Enjoy JavaScripting !!!

.

.

Tuesday, January 13, 2015

Installing node-canvas on Win64 and Visual Studio 2013 Update 4

 

While exploring machine learning using JavaScript I came across this nice video and github project by Heather Arthur.

I decided to try it out, but I had to resolve quite a few issues. Here is the takeaway from the solution:

  • Install 32bit version of python instead of 64bit.

    • This is help overcome a lot of issues later when installing python libraries as the library installer look for details in registry to check if specific version of Python is installed or not. And with 64bit installation it wasn’t able to detect it.

  • node-canvas requires cairo which can be installed on Windows via the GTK+ package.

    • Download the 64 bit 2.22 all-in-one bundle for 64bit machines or else the C++ compiler will throw LINKER errors while building the package.
    • Make sure to follow the instructions in the gtk+-bundle_2.22.1-20101229_win64.README.txt file at the root of the bundle
    • Copy all the contents of the bundle to “C:\GTK” folder as the node-gyp needs that

  • Use the –-msvs_version=2013 switch to install the ‘canvas’ package

    • I got this error while installing the ‘canvas’ npm package from Visual Studio
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.Cpp.Platform.targets(64,5): error MSB8020: The build tools for Visual Studio 2010 (Platform Toolset = 'v100') cannot be found. To build using the v100 build tools, please install Visual Studio 2010 build tools.  Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right-click the solution, and then selecting "Upgrade Solution...".
    • I had to do 2 things to resolve it:
      • Update node-gyp to the latest version, including the one that is internally used by node
      • Use ‘npm install –-msvs_version=2013 canvas’ from command line to install the package.

Finally add the canvas package with version number in dependencies in package.json to make Visual studio happy…

AddIn