Closed ItzNotABug closed 5 months ago
This PR adds the ability to serve static contents, the logic is configurable as well.
public - .env robots.txt app-ads.txt
express.static('public');
This will serve files in the public directory directly when you do - https://function.com/robots.txt.
https://function.com/robots.txt
You can also exclude some files, like the .env file in the public directory with either name or a regex -
.env
express.static('public', [/^\..*env.*/i, 'config.php']);
Base branch used was #view-engine-support.
This PR adds the ability to serve static contents, the logic is configurable as well.
Example -
This will serve files in the public directory directly when you do -
https://function.com/robots.txt
.Excluding some files not meant for public -
You can also exclude some files, like the
.env
file in the public directory with either name or a regex -