Either one will work. The Pot connection has a wider gain adjustment range. As shown the minimum gain is 1 and the maximum is ∞.
One minor note. With the Pot connection any slight open circuit that may occur when adjusting the gain will cause the gain to jump to maximum and the output will likely hit the rail. Whether that's a problem or not depends upon the circuit application.