0
 {
   "name": "openlayers",
   "version": "1.0.0",
   "main": "index.js",
   "scripts": {
   "test": "echo \"Error: no test specified\" && exit 1",
   "start": "parcel  index.html",
   "build": "parcel build --public-url . index.html"
  },
 "author": "",
 "license": "ISC",
 "dependencies": {
 "app-root-path": "^2.2.1",
 "authenticate": "^0.1.5",
 "commonjs": "0.0.1",
 "config": "^3.2.4",
 "document-ready": "^2.0.2",
 "eazy-logger": "^3.0.2",
 "fs": "0.0.1-security",
 "jquery": "^3.4.1",
 "leaflet": "^1.6.0",
 "ol": "^5.3.3",
 "ol-contextmenu": "^3.3.2",
 "ol-hashed": "^2.0.0",
 "ol-layerswitcher": "^3.4.0",
 "proj4": "^2.6.0",
 "sidebar-v2": "^0.4.0",
 "simple-datatables": "^2.1.7",
 "simple-node-logger": "^18.12.23",
 "winston": "^3.2.1",
 "winston-daily-rotate-file": "^3.10.0"
}

Any help would be greatly appreciated. The current url is http://localhost:1234. I want this to be a custom url to authenticate with third party services that will only allow authentication to those urls.

2 Answers2

0

You use the --host option according to the documentation.

So in your scripts section:

"start": "parcel serve index.html --host example.com",
Jeremy Harris
  • 24,318
  • 13
  • 79
  • 133
  • does not work - TypeError: Cannot read property 'port' of null - even if it specify port "start": "parcel serve index.html --host example.com --port 1234", –  Nov 26 '19 at 16:29
  • If you have hot module reloading, then maybe try `--hmr-hostname` instead. – Jeremy Harris Nov 26 '19 at 16:31
  • still not working says Server running at http://localhost:2420 –  Nov 27 '19 at 09:27
  • You can also just put an entry into your hosts file for the domain you want and point it at 127.0.0.1. That should let you authenticate with third parties. – Jeremy Harris Nov 27 '19 at 13:16
0

You have to add domain to hosts file then do as said above.

"start": "parcel serve index.html --host example.com",