  We study the directed polymer (DP) of length $t$ in a random potential in
dimension 1+1 in the continuum limit, with one end fixed and one end free. This
maps onto the Kardar-Parisi-Zhang growth equation in time $t$, with flat
initial conditions. We use the Bethe Ansatz solution for the replicated problem
which is an attractive bosonic model. The problem is more difficult than the
previous solution of the fixed endpoint problem as it requires regularization
of the spatial integrals over the Bethe eigenfunctions. We use either a large
fixed system length or a small finite slope KPZ initial conditions (wedge). The
latter allows to take properly into account non-trivial contributions, which
appear as deformed strings in the former. By considering a half-space model in
a proper limit we obtain an expression for the generating function of all
positive integer moments $\bar{Z^n}$ of the directed polymer partition
function. We obtain the generating function of the moments of the DP partition
sum as a Fredholm Pfaffian. At large time, this Fredholm Pfaffian, valid for
all time $t$, exhibits convergence of the free energy (i.e. KPZ height)
distribution to the GOE Tracy Widom distribution
