You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ItzNotABug edited this page May 3, 2024
·
1 revision
You can serve static content meant for public access directly without any routing or a middleware. This behaviour is similar toexpress.static() middleware.
First off, define a directory that contains the static content like this -
appExpress.static('public');
Now you can directly access the contents by visiting the file paths.
You can also exclude certain files, in case of sensitive content, or you use a middleware to handle a content -