I am trying to get one back folder path from the url.But not working.I do not know how to get the path?
I expected url name like http://localhost/testing/ from http://localhost/testing/flower/
Example:
const path = require('path');
var url = http://localhost/testing/flower/
var reqPath = path.join(url, './');
console.log( reqPath );
./is current, not back./if it exists then substring from start until last occurence of/. Add som handling of root path on that an you're golden