updating main.rb to reflect change of url to amd.im and to have the new index page.
This commit is contained in:
parent
4f11711f5b
commit
232ccef31d
1 changed files with 8 additions and 3 deletions
11
main.rb
11
main.rb
|
@ -11,8 +11,8 @@ configure do
|
||||||
require 'ostruct'
|
require 'ostruct'
|
||||||
Shorten = OpenStruct.new(
|
Shorten = OpenStruct.new(
|
||||||
:base_url => ENV['url'],
|
:base_url => ENV['url'],
|
||||||
:service_name => "➼.ws",
|
:service_name => "amd.im",
|
||||||
:button_text => "➼",
|
:button_text => "shorten",
|
||||||
:path_size => 4
|
:path_size => 4
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -60,6 +60,11 @@ helpers do
|
||||||
end
|
end
|
||||||
|
|
||||||
get '/' do
|
get '/' do
|
||||||
|
@information = show_information
|
||||||
|
erb :index
|
||||||
|
end
|
||||||
|
|
||||||
|
get '/new' do
|
||||||
@information = show_information
|
@information = show_information
|
||||||
erb :new, :locals => { :type => "main" }
|
erb :new, :locals => { :type => "main" }
|
||||||
end
|
end
|
||||||
|
@ -126,7 +131,7 @@ post '/upload' do
|
||||||
#filename = params[:file][:filename]
|
#filename = params[:file][:filename]
|
||||||
|
|
||||||
# upload to S3
|
# upload to S3
|
||||||
AWS::S3::S3Object.store(filename, open(params[:file][:tempfile]), 'shorten', :access => :public_read)
|
AWS::S3::S3Object.store(filename, open(params[:file][:tempfile]), 'amdim', :access => :public_read)
|
||||||
object_url = AWS::S3::S3Object.url_for(filename, 'shorten', :authenticated => false)
|
object_url = AWS::S3::S3Object.url_for(filename, 'shorten', :authenticated => false)
|
||||||
|
|
||||||
# generate shorturl
|
# generate shorturl
|
||||||
|
|
Loading…
Reference in a new issue