Welcome to the Treehouse Community
Looking to learn something new?
Why are we using '/static' - as opposed to '/public'?
Curious as to why we use '/static' vs any other term, especially '/public'?
Andrew ChalkleyTreehouse Guest Teacher
I haven't seen this particular video but
public are both common directories for "static assets" or "publicly accessible assets".
Anthony c20,907 Points
Is there an upside to passing the files through "/static"?
Why not just name the "public" folder "static" to begin with?
app.use('/static', express.static(__dirname + '/public'))
and not this
app.use(express.static(__dirname + '/static'))
.static is built in middleware for Express.js. So using /static directory to store all your static asset files is -- although extremely helpful -- simply a naming convention.
In the context of the massive info dump that comes with inevitably distilling a complex toolset into a few short videos, this can seem like just one more little thing to remember.