Baby sleeping in bouncer?

Today I tried letting my son sleep in the bouncer for the night because he just doesn't seem to sleep very well in the bassinet and he slept for the whole night, only waking up to feed. I want to do what's best for him and I heard that babies should sleep flat because It helps with spine development so I don't know if I can keep letting him sleep in the bouncer?