Controlling Servo motor SG90 from NodeMCU 1.0 development kit
With NodeMCU you can use the pwm module like this:

local pin4 = 4
--setup at position 0
pwm.setup(pin4, 50, 71)
--turn to position -90
pwm.setduty(pin4, 27); pwm.start(D5); tmr.delay(500000); pwm.stop(D5)
--turn to position 0 again
pwm.setduty(pin4, 71); pwm.start(D5); tmr.delay(500000); pwm.stop(D5)
--turn to position +90
pwm.setduty(pin4, 123); pwm.start(D5); tmr.delay(500000); pwm.stop(D5)


27, 71 and 123 are the appropriated duty cycle "time" to set the desired position from 0 to 180 degrees up. I found this by experimenting.

For more information you can check the sg90 manual here and pwm module manual here.