0

My code looks like this:

enter image description here

and the terminal output looks like this: enter image description here

But I dont want the path to be under "routes". But rather under bears/public/...

Appreciate any help!

Simon Guldstrand
  • 488
  • 1
  • 5
  • 24

1 Answers1

4

In your current setup, you're just joining the path as a string. This doesn't allow you to move up levels within your folder structure.

var path = require("path")

var target_path = path.join(__dirname, "../public/images/bjornar")

The path module will join them as if you were moving around in command line.

chrisbajorin
  • 5,993
  • 3
  • 21
  • 34