Running NAR’s open source webAPI server


We followed some counsel to augment our Visual Studio 2013 installation with “node.js” tools, with a view to running NAR’s open source webapi server.

image

http://www.hanselman.com/blog/IntroducingNodejsToolsForVisualStudio.aspx

 

We learned about NAR’s open source material from a member’s only resource:

 

image

http://members.reso.org/display/TRANSPORTDF/NAR+Open+Source+Recap

which referred to

image

https://github.com/NationalAssociationOfRealtors

Using these sources and the knowhow taught by bloggers, we launched visual studio with a view to getting the point where we can run and debug the NAR webAPI server. This required using git, in visual studio, to clone the repository for the reso-api-server and then make a new node.js project, that imported the (existing) repository files.

 

image

 

Using the npm tools, we download the referenced packages. Next we followed the instructions to get the main package:

image

we had to change the dependency type from the default (and chose GLOBAL) to avoid the error shown in the console, left.

This all teaches us that perhaps we are going down the wrong path – not know what Global even  is, etc.

So we start again, simply creating a new node.js application, to which we install the reso-api-server as a standard package. Then we following the metadata and configuration setup instructions:

 

image

we take a guess at some reasonable configuration parameters:

#
# Configuration file for a RESO API Server
#
#
# API Service
#
COMPRESSION:        false   
SERVER_DOMAIN:        localhost
SERVER_NAME:        RESO API Server   
SERVER_PATH:        listing.svc   
SERVER_PORT:        42999
SERVER_PROTOCOL:    http   
#
# Data Processing 
#
EXTERNAL_INDEX:        true   
LOG_ENTRY:        false   
METADATA_DEFINITION:    ./metadata/reso_1_2.js
PROCESS_WAIT:        15   
RESPONSE_LIMIT:        200   
#
# HTTPS Certificates
#
#CA_CERTIFICATE:        ./ssl/ca.crt
#SERVER_CERTIFICATE:    ./ssl/server.crt
#SERVER_KEY:        ./ssl/server.key
#
# Authentication
#
#AUTH_REALM:        RESO API SERVER   
#AUTH_TYPE:        Basic   
#AUTH_TYPE:        Digest   
AUTH_TYPE:        None   
#
# OAuth2 Services
#
#OAUTH2_URI:        https://localhost:1340/authorize   

 

Running the sample startup file, we get

image

we attempt to fix by taking the “alternative” configuration path, using the data dictionary package.

image

image

Augmenting the instructions, we consult

 

This fixes one startup issue, but then we hit a next – obviously related to SSL setup:

image

image

http://nodejs.org/api/tls.html

we install openssl (that NSA-friendly package full of strangely broken crypto and security protocols, supported by “american foundations”);

image

http://slproweb.com/products/Win32OpenSSL.html

Several things seem to fix, on merely installing openssl (and adding the bin directory to the system path).

Without creating any ssl/ directory (or keys), and having adjusted the test.js and service.conf to be in the root project directory (and out of the metadata/ directory), we now get

image

which we guess means we are missing a mongodb server (listening on the port mentioned).

image

image

Lets guess, given the code below, that we followed bad instructions, initially – and somehow were not reading the correct files, in the right directories etc.

image

as it actually stands, after all this confusion:

a) we have a mongdb instance

image

and

b) a visual studio debugging instance of the node.js process (THAT evidently has a connection to a mongdb with zero entities).

image

at which point we seem able to boot a components hosting a couple of services

image

Advertisements

About home_pw@msn.com

Computer Programmer who often does network administration with focus on security servers. Very strong in Microsoft Azure cloud!
This entry was posted in odata. Bookmark the permalink.