Look for examples of using an ESP8266 board with an UNO/Mega. What you have is basically a Mega and ESP8266 built onto the same board, using one of the Mega's serial ports for communications between the two (provided you have the onboard DIP switches set correctly).