ESP8266 Webserver ESP8266WebServer move Handler-Function in separate .h .c file
Move the webserver to index.c and include the webserver type:

ESP8266WebServer server(80);


Add an external reference in index.h and include it:

#include "ESP8266WebServer.h"

extern ESP8266WebServer server;


Index.h is included by both main.c and index.c so it will know about server being an ESP8266WebServer type, but does not allocate memory for it; that is done in index.c

This is called a forward reference.