windowslocalhosthosts-file

How to change the URL from “localhost” to something else, on a local system using Flask?


On a Windows machine, there's a system running on the local FLask server, but while the application is running on localhost.

While the Default I would expect the URL to be like this based on the directory structure:

http://localhost/swagger

But The developer has managed to do this:

http://ap-mispro/swagger

So instead of localhost, the URL says ap-mispro.

And both URLs work fine.

But How is the second URL at Flask/swagger works and how to setup similar stuff I know about wammp server and it can done through ini file but to do same for flask ?


Solution

  • You can perform this by modifying c:\windows\system32\drivers\etc\hosts

    Simply replace localhost with ap-mispro it should look like :-

    127.0.0.1 ap-mispro