3 ms·
CGI is an interface for web servers to communicate with an application. Web frameworks are libraries/helpers on the application side to help with business logi
by paxys 5y ago
CGI is an interface for web servers to communicate with an application.
Web frameworks are libraries/helpers on the application side to help with business logic for serving requests.
You can use CGI with web frameworks (look at the ton of useful PHP/Perl/Ruby frameworks out there).
You can also build a fully competent website without CGI OR web frameworks. Modern languages now all have built-in web servers which perform a lot better so Apache/nginx etc. need to function at most as reverse proxies.
In fact even if teaching is the goal I'd argue that Apache/CGI introduce more opaque abstractions, not less. You can create a web server and request loop in any language of choice in like 10 lines and take it from there.