From d8432c2339304f27420833e18d4ac10576d54ee5 Mon Sep 17 00:00:00 2001 From: Darren Boss Date: Thu, 17 Jun 2021 09:15:41 -0700 Subject: [PATCH] - Use https module to make requests to the MCPM catalog - Fix typos in README: -global -> --global - Alphabetize dependencies in package.json - Test app should reference smk package in the @bcgov scope --- README.md | 4 ++-- build/test-app/index.html | 2 +- package.json | 4 ++-- smk-edit/controllers/catalogs.js | 7 +++---- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 35340ce..c50d894 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ either local to the current project, or globally for your whole system. To install the command globally, so it can be used from any project in our system, use this command: - npm install -global @bcgov/smk-cli + npm install --global @bcgov/smk-cli This may require you to use administrative rights (or `sudo`) on your machine, depending on how it is configured. @@ -53,4 +53,4 @@ For more information on the SMK project, or to read documentation on SMK develop # Uninstall - npm uninstall —global @bcgov/smk-cli + npm uninstall --global @bcgov/smk-cli diff --git a/build/test-app/index.html b/build/test-app/index.html index 2f6d8af..fd038de 100644 --- a/build/test-app/index.html +++ b/build/test-app/index.html @@ -15,7 +15,7 @@ - + diff --git a/package.json b/package.json index 7c72046..5b6c2d3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@bcgov/smk-cli", - "version": "1.0.0", + "version": "1.0.1", "description": "A utility for creating and configuring a Simple Map Kit project", "main": "index.js", "author": "Ben Jubb ", @@ -16,6 +16,7 @@ "debug": "./index.js edit --open no --base build/test-app --ping 300000" }, "dependencies": { + "@bcgov/smk": "^1.0.2", "@tmcw/togeojson": "^4.1.0", "chalk": "^4.1.0", "cors": "^2.8.5", @@ -35,7 +36,6 @@ "semver": "^7.3.2", "shapefile": "^0.6.6", "shelljs": "^0.8.4", - "@bcgov/smk": "^1.0.2", "touch": "^3.1.0", "unzipper": "^0.10.11", "xml2js": "^0.4.23", diff --git a/smk-edit/controllers/catalogs.js b/smk-edit/controllers/catalogs.js index a723d56..a063ddc 100644 --- a/smk-edit/controllers/catalogs.js +++ b/smk-edit/controllers/catalogs.js @@ -1,5 +1,5 @@ const xml2js = require( 'xml2js' ).parseString -const http = require( 'http' ) +const https = require( 'https' ) const layer = require( './layer.js' ) const path = require( 'path' ) const fs = require( 'fs' ) @@ -12,7 +12,6 @@ const DATABC_SERVICE_URL = 'https://maps.gov.bc.ca/arcgis/rest/services/mpcm/bcg const MPCM_OPTIONS = { host: 'apps.gov.bc.ca', - port: '80', path: 'https://apps.gov.bc.ca/pub/mpcm/services/catalog/PROD', method: 'GET', headers: { @@ -68,7 +67,7 @@ function getMpcmCatalog( req, res, next ) { } console.log( ' Loading MPCM Catalog from ' + MPCM_OPTIONS.path ) - var mpcmReq = http.request( MPCM_OPTIONS, function( resp ) { + var mpcmReq = https.request( MPCM_OPTIONS, function( resp ) { resp.setEncoding('utf8'); var msg = '' @@ -111,7 +110,7 @@ function getMpcmCatalogLayerConfig( req, res, next ) { options.path += '/' + mpcmId; console.log( ' Loading MPCM Layer from ' + options.path ) - var mpcmReq = http.request( options, function ( resp ) { + var mpcmReq = https.request( options, function ( resp ) { resp.setEncoding('utf8'); var msg = '';