title: ESP32 Web Server Problem (Not triggering the function)
body: <p>I want to open and close trigger using web server on ESP32,everything seems to be ok but it doesnt tring the function, what am i doing wrong, I dont need a web page for it, I just want to trig it via link  ;</p>
  <p>This is the link i am trying to trigger function from my pc;
  http://esp-ip-address/up</p>
  <pre><code>#include &lt;WiFi.h&gt;
  #include &lt;WebServer.h&gt;
  #include &lt;Servo.h&gt;
  
  #define MZ80_ENTER  32
  #define MZ80_EXIT  33
  #define SERVO_ENTER 22
  #define SERVO_EXIT 23
  
  int enter_flag = 1, exit_flag = 0;
  
  Servo servo_enter;
  Servo servo_exit;
  
  
  const char* ssid = &quot;ssid&quot;;
  const char* password = &quot;pass&quot;;
  
  WebServer server (80);
  
  bool state = false;
  
  void setup (){
    Serial.begin(9600);
  
    pinMode(MZ80_ENTER, INPUT);
    pinMode(MZ80_EXIT, INPUT);
    servo_enter.attach(SERVO_ENTER);
    servo_exit.attach(SERVO_EXIT);
    servo_enter.write(0);
    delay(100);
  
    WiFi.begin(ssid, password);
  
    server.on(&quot;/&quot;, handleRoot);
    server.on(&quot;/up&quot;, handleup);
    server.on(&quot;/down&quot;, handledown);
    server.onNotFound(handleNotFound);
  
    server.begin();
    Serial.println(&quot;Web Server Running !&quot;);
    delay(150);
  }
  
  void loop(){
    server.handleClient(); 
    if (state){
      if (digitalRead (MZ80_ENTER) == 0 &amp;&amp; enter_flag == 1) {
        servo_enter.write(100); 
        servo_exit.write(0);
        exit_flag = 1;
        enter_flag == 0;
        Serial.println (&quot;Up&quot;);
        delay(500);
      }
    }
    else{
      if (digitalRead (MZ80_EXIT) == 0 &amp;&amp; exit_flag == 1) {
        servo_exit.write(100); 
        servo_enter.write(0); 
        enter_flag = 1;
        exit_flag == 0;
        Serial.println (&quot;Down&quot;);
        delay(500);
      } 
    }  
  }
  
  String answer = &quot;Web Loaded !&quot;;
  
  
  void handleRoot(){
    server.send(200,&quot;text/html&quot;,answer); 
  }
  
  void handleup(){
    state = true ; 
    server.send(200,&quot;text/html&quot;,answer); 
  }
  
  void handledown(){
    state = false ;
    server.send(200,&quot;text/html&quot;,answer); 
  }
  
  void handleNotFound(){
    server.send(404,&quot;text/html&quot;,&quot;Error 404 NOT FOUND&quot;);
  }
  </code></pre>
  <p>Thanks in advance</p>