I need advvice 27 weeks pregnant and had horrible pain last night

Hannah

I'm 27 weeks and last night I got up to eat and went to lay back down and had really bad pain under my left rib it got worst and started to move down to my lower part of my belly it would start to go away feel better and then it was like everything was toghting up and i was in pain again it was very irregular but it was painful after a couple hours it had stopped and I finally was able to fall asleep I woke up feeling kinda off but not in pain and haven't had any pain I have felt the baby kicking but it scares me but since I don't have anymore pain I don't know if I should go get it checked out or what I should do?