title: How to access Heroku Uploaded Image;
body: <p>I successfully writed an image to Heroku, but i can't figure out how to access to it.</p>
  
  <pre><code>function saveImage(req,res) {
    const roomID = req.params.id;
  
    pool.query('SELECT * FROM ' + roomTable + ' WHERE id = $1', [ roomID ],function(err, result) {
      if(err){
        res.json(
          { "status": err.message }
        )
      } else {
        const selectedRoom = JSON.parse(JSON.stringify(result.rows[0]));
          if(selectedRoom.image_url === null){
            const image = req.body.image_data;
            const fileName = uuid.v4();
            const filePath = __dirname + "/image/" + fileName + ".png" 
            const base64Data = image.replace(/^data:image\/png;base64,/, "");
  
            fs.existsSync("image") || fs.mkdirSync("image");
            fs.writeFile(filePath,  new Buffer(base64Data, "base64"), function(err) {
              if(err) {
                  res.json(
                    { "status": err.message }
                  )
              }else{
                pool.query('UPDATE '+ roomTable +' SET image_url = $1 WHERE id = $2;', [filePath, roomID] ,function(err, result) {
                if(err){
                  res.json(
                    { "status": err.message }
                  )
                } else {
                  console.info("The file was saved!");
                  res.json({
                    "status": "ok",
                    "path": filePath
                  });
                }
                })
              }});
          }else {
            res.json({
              "status": "error",
              "message": "The room has an image already."
            });
          }
      }
    })
  }
  </code></pre>
  
  <p>My server is running on heroku. If i send a request, i get back the right response.</p>
  
  <pre><code>{
      "status": "ok",
      "path": "/app/image/04efd85d-e9db-4965-b15f-3840dbd344f3.png"
  }
  </code></pre>
  
  <p>So, after that the image writed to heroku.</p>
  
  <p>but if i would like to access it, on the url:</p>
  
  <pre><code>https://myurl/app/image/04efd85d-e9db-4965-b15f-3840dbd344f3.png
  </code></pre>
  
  <p>or, in that url:</p>
  
  <pre><code>https://myurl/image/04efd85d-e9db-4965-b15f-3840dbd344f3.png
  </code></pre>
  
  <p>i also tried to provide it:</p>
  
  <pre><code>app.use('/image', express.static('image'));
  app.use(__dirname + '/image', express.static('image'));
  </code></pre>
  
  <p>So the question is that, how can i access to my url in heroku after writing it there. I don't want to use Amazon S3.</p>