What the heck happened?

So, last night I was awoken at 3am to this awful chest pain and rib pain. I figured it was indigestion and drink some water and laid back down with my upper body inclined. 30 minutes pass and the pain is still pretty uncomfortable, so I sit up hoping it helps and get hit with nausea. I run to the bathroom and puke up EVERYTHING in my stomach, waking my poor husband up. I laid back down, because my chest felt better, and figured it was over. But no, about 10 minutes after I laid down, I had really bad rib pain and back pain. I couldn’t get comfortable, so I tried moving into positions to help. The pain kept getting more intense, my entire upper abdomen and my upper back and shoulders felt like they were being crushed and stabbed at the same time. I started crying, and then eventually started crying out because the pain was so immense. I honestly thought I was dying or having a heart attack, so my husband got up to wake the kids up so we could go to the hospital. I was sweating so bad, I ripped off my shirt and laid at the end of our bed under the fan and somehow, the pain started to go away. I stopped my husband from getting the kids up and just layed there praying to God to take the pain away. About 5 minutes later, the pain completely disappeared. The episode lasted 25 mins tops, but it was literally the worst pain I have felt in my life and I have birthed 2 children. I’m 31 weeks, and have an appointment at 1:30pm today so I will ask my doctor but has anyone gone through this or experienced something like this? I feel like I’m going crazy.

Edit: Doctor said it sounded like a gallbladder issue and advised me to take Tylenol if the pain happens again. Nothing they can do besides wait until after baby is born to see if it needs removal or not.

I knew it wasn’t normal heartburn, I take Zantac 150 twice a day religiously. I have never experienced that kind of pain before.