'How to run a go-gin server on a specific IP address

I am running a gin server using

r.RunTLS(":8080" , "domain.crt", "domain.key")

This starts the server with localhost as host-name. I can access my APIs using localhost host-name. How can I change this behavior to point to IP address instead of localhost?

go


Solution 1:[1]

you can use this:

   r := gin.Default()
   r.Run("IP:PORT")

(change IP and PORT to sample as you want)

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 mahdi gadget