What are these routing styles called in a web appl

2019-07-25 19:46发布

问题:

What do you call routing that maps one URL directly to a file?

Example:

http://localhost/directory/file.php => /var/www/apache/htdocs/directory/file.php

What do you call routing like one on https://github.com/nikic/FastRoute?

Example:

http://localhost/directory/file => request actually goes to a single index.php file, which then loads routing files or tables and loads appropriate class as defined in the routing table.

回答1:

What do you call routing that maps one URL directly to a file?

I would call that no routing. Or maybe direct routing? I've never heard anybody use a term specifically for it.

What do you call routing like one on https://github.com/nikic/FastRoute?

That's (typically) the front controller pattern.