I have my mac serving an application on port 80 that I can access within the network, how can I prevent it from sleeping?
Lid Open

Your Mac will sleep if you close the lid.

You need to leave your MacBook lid open for the server to keep responding to requests.

You can set the display to sleep after a period of idle time; this will not affect the server. Only the computer needs to remain awake.