In manifest.json, what exactly is the difference between setting start_url to "." and setting it to "./". Similarly, what exactly is the difference between setting scope to "." and setting it to "./"?
I have a React app deployed behind a reverse proxy server which is accessed by the URL (https://www.example.com/scorer). I am trying to migrate it to a PWA. Pretty easy, except that in manifest.json, I must set
"start_url": "./",
"scope": ".",
Anything else doesn’t seem to work. For example,
"start_url": ".",
"scope": ".",
doesn’t work. I understand that these are relative paths (to the manifest URL), but I just don’t get the difference between setting start_url to "." and setting it to "./" (and ,similarly, what the difference between setting scope to "." and setting it to "./").
2
Answers
You can add the to
package.json
an key that called"homepage"
,Then the url will start with scope.
If you add:
Then the url will be :
https://blah.com/test
According to MDN:
And, according to this site:
Therefore "./" would mean that the server should look for the React file inside the folder. e.g. "C://inetPub/example/scorer".
And "/" would mean that the file should be found inside the root folder. e.g. "C://inetPub/".
But this depends on your server configuration. I’ve tested it using IIS 5 with default configuration.