You could script a request to `/api/me` and continue only when you get a 200. The server will return 502 until it's ready to handle requests.