added some simple styles to make it nicer
parent
47f8741592
commit
c0c82e5395
2
app.rb
2
app.rb
|
|
@ -20,7 +20,7 @@ class App < Roda
|
|||
r.post "create" do
|
||||
url = r.params['url']
|
||||
if nil == links.filter(:url => url).first
|
||||
code = SecureRandom.urlsafe_base64 5
|
||||
code = SecureRandom.urlsafe_base64 4
|
||||
links.insert(url: url, code: code)
|
||||
end
|
||||
@new_link = 'http://' + request.env['HTTP_HOST'] + '/' + links.filter(:url => url).first[:code]
|
||||
|
|
|
|||
|
|
@ -3,8 +3,10 @@
|
|||
<title><%= @page_title || "URL Shortener" %></title>
|
||||
<link rel="icon" href="data:,">
|
||||
</head>
|
||||
<body>
|
||||
<h1>URL Shortener</h1>
|
||||
<%== yield %>
|
||||
<body style="background: #FEFEFE; font-family: Helvetica, sans-serif;">
|
||||
<main style="max-width: 30rem; min-width: 18rem; border: 2px solid #111111; border-radius: 20px; margin: auto; padding: 1rem; margin-top: 5rem; text-align: center;">
|
||||
<h1>URL Shortener</h1>
|
||||
<%== yield %>
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
Loading…
Reference in New Issue