Skip to content

Instantly share code, notes, and snippets.

@richardraseley
Last active August 29, 2015 13:55
Show Gist options
  • Save richardraseley/8722665 to your computer and use it in GitHub Desktop.
Save richardraseley/8722665 to your computer and use it in GitHub Desktop.
require 'json'
require 'sinatra'
set :port => 8080, :bind => '0.0.0.0'
get '/images' do
fs = Dir.glob('/home/user/packer-resources/images/*')
h = {}
h[:images] = []
fs.each do |f|
h[:images] << f
end
h.to_json
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment