Reputation: 84
I have a website which I desire to browse the https://somewebsite/public/images/
folder, which is possible through the browser. I want to map the contents of it and do a bunch of stuff. But I am having a hard time getting the contents of said folder using nodejs. Is there a way to get the contents of a remote directory?
I have no access to the code of this website whatsoever. To give you more information about this. I don't have access anymore to this website, the credentials to access it were lost, and I have to retrieve all the files from it.
Upvotes: 0
Views: 374
Reputation: 36319
You really should provide more information, like if you're using express
and what you've tried so far.
If you are using Express, the easiest thing to do would be to install the serve-index module and configure it.
$ npm install --save serve-index
Then in your express startup file:
var express = require('express')
var serveIndex = require('serve-index')
var app = express()
// Serve URLs like /ftp/thing as public/ftp/thing
app.use('/images', serveIndex('public/images', {'icons': true}))
app.listen()
Upvotes: 1