Skip to content

Commit

Permalink
Merge pull request #62 from bcgov/#61.mpcm.catalog.fails.to.load
Browse files Browse the repository at this point in the history
Use HTTPS to fetch MPCM layer catalog
  • Loading branch information
dgboss authored Jun 22, 2021
2 parents 730955f + d8432c2 commit 09b8328
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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
2 changes: 1 addition & 1 deletion build/test-app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

<footer>Application constructed by smk-cli at 2020-07-23T19:18:25.876Z</footer>

<script src="./node_modules/@qqnluaq/smk/dist/smk.js"></script>
<script src="./node_modules/@bcgov/smk/dist/smk.js"></script>
<script src="./smk-init.js"></script>
</body>
</html>
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -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 <benjubb@gmail.com>",
Expand All @@ -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",
Expand All @@ -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",
Expand Down
7 changes: 3 additions & 4 deletions smk-edit/controllers/catalogs.js
Original file line number Diff line number Diff line change
@@ -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' )
Expand All @@ -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: {
Expand Down Expand Up @@ -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 = ''
Expand Down Expand Up @@ -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 = '';
Expand Down

0 comments on commit 09b8328

Please sign in to comment.