Q:

JavaScript - List application side files on static web page

I am writing a small static website. The website should include a "photo gallery". Since new albums will be added as time goes on, I want to write some javascript code that will look in the "albums" folder on the application side, not client side, and then list all folders and files in that folder so that I can add the pictures dynamically.
Folder structure:
app
- albums
  - album1
    - img1.jpg
    - img2.jpg
    - img3.jpg
  - album2
    - img1.jpg
    - img2.jpg
    - img3.jpg
- index.html
- page1.html
- page2.html

I'm figuring this must be possible somehow since I can specify with src="" if I hard code the image locations in  tags.
As far as I can figure out the JS File API only works on the client side?
I am planning to host this site in an AWS S3 bucket. Maybe I should use some AWS library for this functionality?

A:

I would suggest using the AWS S3 JS SDK which would allow you to access the bucket tree from both Client and Server depending on how complicated you need this to be.
http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html

