Skip to content

Instantly share code, notes, and snippets.

@sirws
Last active August 29, 2015 14:20
Show Gist options
  • Save sirws/18ef7aff58ad14a78246 to your computer and use it in GitHub Desktop.
Save sirws/18ef7aff58ad14a78246 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. Install cURL for Windows (http://www.confusedbycode.com/curl/)
6. Install koop-sample-app (https://github.com/koopjs/koop-sample-app)
7. Add virtual directory to iis for koop and point to koop-sample-app location (in my case d:\koop-sample-app
8. Add web.config with URL rewrite mod to d:\koop-sample-app
<add sample>
9. 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);
10. 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"
}
}
11. update d:\koop-sample-app\node_modules\koop-socrata\routes\index.js to add koop virtual dir
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