skip to Main Content

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


  1. You can add the to package.json an key that called "homepage",
    Then the url will start with scope.

    If you add:

    "homepage": "test"
    

    Then the url will be : https://blah.com/test

    Login or Signup to reply.
  2. According to MDN:

    The start_url member is a string that represents the start URL of the web application

    And, according to this site:

    Relative path examples

    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.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search