Skip to content

Commit

Permalink
fixing default POST routes and worker exits on errors
Browse files Browse the repository at this point in the history
  • Loading branch information
chelm committed Feb 10, 2015
1 parent 1fa4b25 commit 6381fd3
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ module.exports = function( config ) {
if ( controller[ handler ] ){
defaultRoutes[ handler ].forEach(function(route){
app[ 'get' ]( '/'+ name + pattern + route, controller[ handler ]);
app[ 'post' ]( '/'+ name + pattern + route, controller[ handler ]);
});
}
}
Expand Down
1 change: 1 addition & 0 deletions lib/ExportWorker.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ function createFiles(job, done){
info.generating = { error: e };
koop.Cache.updateInfo( task.table, info, function(err, res){
done('failed to generate file ' + e);
workerQ.kill();
cb();
});
}
Expand Down
6 changes: 3 additions & 3 deletions lib/GeoJSON.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@ exports.fromEsri = function( fields, json, callback ){
} catch (e){
if ( dateFields.length ){
dateFields.forEach(function(d,i){
if ( newFeature.attributes[d] ){
feature.attributes[d] = new Date(feature.attributes[d]).toISOString();
if ( f.attributes[d] ){
f.attributes[d] = new Date(f.attributes[d]).toISOString();
}
});
}
Expand All @@ -147,7 +147,7 @@ exports.fromEsri = function( fields, json, callback ){
geometry: null
};
geojson.features.push( newFeature );
console.log('error parsing feature', e, f);
//console.log('error parsing feature', e, f);
}
});
callback(null, geojson);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "koop",
"version": "1.0.13",
"version": "1.0.14",
"description": "A node module/express middleware for converting GeoJSON to Esri Feature Services.",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 6381fd3

Please sign in to comment.