The Messenger of Allah (ﷺ) used to pray in the folds of the sheep and goats before the mosque was built.
Sahih Muslim Book 5, Hadith 14