Can we provide a project url which is hosted locally as the 'source site' while creating a moovweb project?

StackOverflow https://stackoverflow.com/questions/18981382

  •  29-06-2022
  •  | 
  •  

Pregunta

Will it be possible to create a moovweb project by providing url of the local project as source site value??Is it necessary that the site should be live?

¿Fue útil?

Solución

You can modify the config.json file in your Moovweb project so that the right-hand side mapping is a local path. For example:

{
  "host_map": [
    "$.mylocalsite.com => localhost:3000",
    "anotherlocaladdress.com => localhost:9292"
  ]
}

You can actually put any path in the left-hand side as well. This will just translate into a modification in your computer's hosts file. The $ symbol denotes the -host-var parameter that you can run the server with. If you don't specify this parameter, it will default to mlocal. Notice there is no $ in the second entry. This just means that path will not be dependent on the -host-var parameter.

Once you start the server with moov server, the entries in config.json will result in these entries in your hosts file:

127.0.0.1 mlocal.mylocalsite.com
127.0.0.1 anotherlocaladdress.com

If you specify the -host-var parameter to be mtest, the resulting entries will be:

127.0.0.1 mtest.mylocalsite.com
127.0.0.1 anotherlocaladdress.com

You will also see the related .moovapp.com entries; these are mapped automatically for testing purposes.

The default ports that moov server runs at include 80, 443, 3003, and 8004, but you can modify these to suit your local environment. If you want to run other local servers, make sure they do not conflict.

The caveat is none of this will work if you try to push to the Moovweb Cloud. Remember to change the mapping to reflect an actual live URL when you're ready.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top