how to use ipad to access webserver on macbook air
localhost is device-specific, so visiting it on your iPad is is taking you to a page on your iPad itself (that probably doesn't exist).

To access a page that is served from your Mac from your iPad, use the Mac's local IP address instead of localhost. To get your Mac's local IP, open the Network pane of System Preferences. Select your active network on the left and the IP will be shown on the right under the Connected heading. It will probably be something that looks like 10.0.1.1 or 127.0.1.1.