This github includes the complete code of setting NodeMCU ESP8266 Board as a Webserver.
You can also request a data http://192.168.43.32/ledon to turn on the LED and http://192.168.43.32/ledoff to turn off the LED. Note: Use your own IP Address in place of 192.168.43.32 in the above requests
Also you can use the Arduino Automation App to turn on/off the LED. App link: https://play.google.com/store/apps/details?id=com.himanshu.ArduinoAutomation
To know more about this you can watch this video: https://youtu.be/bv-Syl5qMBU