Angular Fullstack on Windows IIS

Running NodeJS on an IIS server is a challenge on it’s own. Configuring it to work correctly with your angular fullstack project generated with YeoMan is an additional challenge. Below you can find a gist that should get you started with your web.config which is needed to run NodeJS under IIS.

Node ODBC MSSQL Last Insert ID

Breaking your head over how to get theĀ last insert id using node and ODBC for MSSQL? So was I. If you perform an insert query such as:

db.query('INSERT INTO Users (name) VALUES ("Jane Doe");

Followed by


You will be out of scope and get a nice NULL object in your callback. The solution is to perform both queries in once call.

db.query('INSERT INTO Users (name) VALUES ("Jane Doe"); SELECT SCOPE_IDENTITY() as lastInsertId');

React cannot find module copyProperties

Error: Cannot find module 'react/lib/copyProperties'

Having a headache with this one? Well, so was copyProperties has been removed and replaced by objectAssign.

So instead of this
var copyProperties = require('react/lib/copyProperties');

You want to do this
var objectAssign = require('react/lib/Object.assign');

Implementation does not change. Luckily.

NoMethodError: undefined method `spatial’ using rgeo and activerecord-mysql2spatial-adapter

Are you experiencing the error below? Well, so was I. It appears that the schema.rb is not correctly generated and you will have to change that manually.

NoMethodError: undefined method `spatial’ for #
/home/rails/vendor/bundle/ruby/2.1.0/gems/rgeo-activerecord-0.4.6/lib/rgeo/active_record/common_adapter_elements.rb:105:in `method_missing’

Look in your schema.rb and find a line similar to
t.spatial "latlon", limit: {:type=>"point"}

Change it to
t.column "latlon", :point, null: false