ESP8266 Webserver Help

I am using a Webserver example from the esp8266 library. I want to use a servo that moves left to right in a smooth operation. For i that i want to do it in a for loop. But i dont know how to handle the server in the meanwhile. Has someone an idea? I appreciate help.

A web server is program code that handles requests from a web browser.

A servo is a device capable of controlled motion.

What does one have to do with the other?

I know.
The goal is to toggle the servo motion with my phone over wifi on and off.

Surrbradl08:
I know.
The goal is to toggle the servo motion with my phone over wifi on and off.

In the web server example, your arduino is pushing the same data in response to any request from your web browser.
You will need to handle only "get" requests, of which there will be 3.

  1. when someone types in the IP address, the browser sends a request for the Main Page, or root directory of your "website" In responding to this request you can evaluate if your servo is on or off and send one of 2 pages, "On" or "Off"

  2. in the "On" page, you can have a link which will generate a request for "Off" when clicked by the web surfer.

  3. in the Off page, you can have a link which will generate a request for "On" when clicked by the web surfer.

To mod the example, you will need to setup branches with conditions to evaluate the request and run the appropraite branch to generate the appropriate web page.

I haven't tested this code to know if it works or not, and I am too novice to assure you it works from simply reading the source code. I can say it looks to be along the right path you are wanting to go.