Skip to content

Instantly share code, notes, and snippets.

@sirws
Created May 5, 2015 20:41
Show Gist options
  • Save sirws/17968402fd1982828799 to your computer and use it in GitHub Desktop.
Save sirws/17968402fd1982828799 to your computer and use it in GitHub Desktop.
  1. Install latest version of node.js for windows (https://nodejs.org/)

  2. Install the URL Rewrite module for IIS (http://www.iis.net/downloads/microsoft/url-rewrite)

  3. 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)

  4. Install PostgreSQL 9.4.1 (http://www.enterprisedb.com/products-services-training/pgdownload#windows)

  5. Follow instructions to implement a persistent cache (https://github.com/koopjs/koop-sample-app/blob/master/docs/PG_CACHE.md)

  6. Install cURL for Windows (http://www.confusedbycode.com/curl/)

  7. Install koop-sample-app (https://github.com/koopjs/koop-sample-app)

  8. Add virtual directory to iis for koop and point to koop-sample-app location (in my case d:\koop-sample-app

  9. Add web.config with URL rewrite mod to d:\koop-sample-app

  1. 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);

  1. 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" } }

  2. 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' }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment