hi op. I'm sorry you're going through this. buy as previous posters have already said, you WILL be fine!!
I was in the same sitution back in 2012. I was four months pregnant (we weren't married-had been planning on moving in together so slight difference) when he suddenly announced he wanted nothing to do with me amymore 
I had already given up my house to move in with him so as it was three days before move day that left me with nowhere to live. he could not have cared less though. I was in shock, big time! up until then he had been a lovely and caring partner, very attentive and thoughtful and a perfect gentleman. I also thought we had a good relationship which made it hurt unbelievably. anyway long story short-the whole time we had been together je was also seeing his ex
it hurt like hell. but I coped by basically cutting him out my life completely when pregnant. It was just too painful. you have to grieve. I wish I could wrote more, bit I'm in a rush atm so will try to come back at another point but fast forward to now and my life is pretty rosy. do not panic you will be absolutely fine! my exp was an absolute arse to me and so cruel. I also struggled to cope with his complete lack of well...anything! he all of a sudden didn't care that I had nowhere to live, was petrified (ds was unplanned and I didn't have a 'career' as such, a job which I disliked yes, but no career) or if I was coping/ok. but that spoke volumes about him. anyway v.little contact through pregnancy, then when ds was about 4 months he tried to rekindle our relationship fpr more than a year. I refused every time
and so glad I did! I have have my career I always wanted and using my degree. I have a lovely dp who adores ds and I have my head held high that I didn't go back to that fucking wanker who treated me like a piece of shit as soon as I fell pregnant.
it won't be easy at times, do you have plenty of rl support? but you will have a beautiful new baby!
and although it may seem verrry scary at this moment, it will all fall into place. your ex sounds like a vile waste of space who you are well rid of. he really has done you a favour btw. it took me a loooong time to realise that with exp but it was a huge favour he did me. anyway...need to run but keep posting
and congratulations!