server.on -> loop

Did you try this?

server.on("/blink", []() {
  // the loop function runs over and over again forever
  loop();
});

 void loop() {
    digitalWrite(ledPin, HIGH);   // turn the LED on (HIGH is the voltage level)
    delay(1000);                       // wait for a second
    digitalWrite(ledPin, LOW);    // turn the LED off by making the voltage LOW
    delay(1000);                       // wait for a second
  }