Skip to content

Commit

Permalink
- Use https module to make requests to the MCPM catalog
Browse files Browse the repository at this point in the history
- Fix typos in README: -global -> --global
- Alphabetize dependencies in package.json
- Test app should reference smk package in the @bcgov scope
  • Loading branch information
dgboss committed Jun 17, 2021
1 parent 730955f commit d8432c2
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 d8432c2

Please sign in to comment.