restdeploymentsubdomainproduction-environmenttest-environments

Sequencing of subdomains with non-production environments


Say I have a web app that has a production UI login at:

http://example.com/login

Say this app has a production RESTful API backend rooted at:

http://api.example.com

Now let's say this app has a non-production environment called, say, "dev". The "dev"/non-prod UI login would be:

http://dev.example.com/login

But what should the non-prod RESTful API backend be rooted at?:

And why?


Solution

  • Of course, this is somewhat opinion based, but I would definitely prefer http://api.dev.example.com.

    I would choose http://api.dev.example.com, because it relates to http://dev.example.com like http://api.example.com to http://example.com in the production environment.

    This may not be the case for your specific roject (right now), but this could make your work easier, when it comes to dealing with relative paths/domain names.