Express js static relative parent directory

You should use path.join instead of manually concatening path components. It uses path.normalize, which resolves . and .., handles multiple or trailing slashes, and uses the appropriate file separator for your platform (see: path.sep).

For example,

var path = require('path');

var express = require('express');

var app = express();

app.use(express.static(path.join(__dirname, '../public')));

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)