-
Install latest version of node.js for windows (https://nodejs.org/)
-
Install the URL Rewrite module for IIS (http://www.iis.net/downloads/microsoft/url-rewrite)
-
Install iisnode from GitHub (https://github.com/tjanczuk/iisnode) run setupsamples.bat from command prompt as admin user test it works (http://localhost/node/helloworld/hello.js)
-
Install PostgreSQL 9.4.1 (http://www.enterprisedb.com/products-services-training/pgdownload#windows)
-
Follow instructions to implement a persistent cache (https://github.com/koopjs/koop-sample-app/blob/master/docs/PG_CACHE.md)
-
Install cURL for Windows (http://www.confusedbycode.com/curl/)
-
Install koop-sample-app (https://github.com/koopjs/koop-sample-app)
-
Add virtual directory to iis for koop and point to koop-sample-app location (in my case d:\koop-sample-app
-
Add web.config with URL rewrite mod to d:\koop-sample-app
-
Update server.js in koop-sample-app folder to:
var express = require("express"), cors = require('cors'), config = require("config"), koop = require('koop')( config ), socrata = require('koop-socrata'), ckan = require('koop-ckan'), github = require('koop-github'), agol = require('koop-agol'), gist = require('koop-gist'), pgCache = require('koop-pgcache'); koop.registerCache( pgCache );
and
http.createServer(app).listen(process.env.PORT || config.server.port);
-
update koop-sample-app\config\default.json to use postgres { "server": { "port": 1337 }, "data_dir": "/usr/local/koop/", "db": { "conn": "postgres://username:password@localhost/koopdev" } }
-
update d:\koop-sample-app\node_modules\koop-socrata\routes\index.js to add koop virtual dir Notice the /koop added in front of all routes... module.exports = { 'post /koop/socrata': 'register', 'get /koop/socrata': 'list', 'get /koop/socrata/:id': 'find', 'get /koop/socrata/:id/:item.:format': 'findResource', 'get /koop/socrata/:id/:item': 'findResource', 'post /koop/socrata/:id/:item': 'findResource', 'get /koop/socrata/:id/:item/FeatureServer/:layer/:method': 'featureserver', 'get /koop/socrata/:id/:item/FeatureServer/:layer': 'featureserver', 'get /koop/socrata/:id/:item/FeatureServer': 'featureserver', 'post /koop/socrata/:id/:item/FeatureServer/:layer/:method': 'featureserver', 'post /koop/socrata/:id/:item/FeatureServer/:layer': 'featureserver', 'post /koop/socrata/:id/:item/FeatureServer': 'featureserver', 'get /koop/socrata/:id/:item/thumbnail': 'thumbnail', 'get /koop/socrata/:id/:item/tiles/:z/:x/:y.:format': 'tiles', 'delete /koop/socrata/:id': 'del', 'get /koop/socrata/:id/:item/preview': 'preview', 'get /koop/socrata/:id/:item/drop': 'drop' }