Open thunderwin opened 4 years ago
@thunderwin can you share where 'public' folder located in your project structure? app.use('/static', express.static(path.join(dirname, 'public'))) try to find 'public' in config/public if your 'public' folder located in root folder of your project use app.use('/static', express.static(path.join(dirname, '/../public')));
dirname - The directory name of the current module, so it path to directory where located file you add dirname The path.join() method joins all given path segments together using the platform-specific separator as a delimiter, then normalizes the resulting path.
app.use("/static", express.static(path.join(__dirname, "public")));
How to server static files?
I did some wrong?
I put it on config/express.js