From 1dafad926eaf38a6fbffeade9d9d12a2e44fcc03 Mon Sep 17 00:00:00 2001 From: bkrigel Date: Fri, 29 Jun 2018 17:04:40 -0400 Subject: [PATCH] I sure do like Sinatraaaaaa --- app.rb | 12 ++++++++++++ views/date.erb | 4 ++++ views/goodbye.erb | 2 ++ views/hello.erb | 5 +++++ 4 files changed, 23 insertions(+) create mode 100644 views/date.erb create mode 100644 views/goodbye.erb create mode 100644 views/hello.erb diff --git a/app.rb b/app.rb index 254fe3f..b30ded4 100644 --- a/app.rb +++ b/app.rb @@ -4,5 +4,17 @@ class App < Sinatra::Base erb :index end + get '/hello' do + erb :hello + end + + get '/goodbye' do + erb :goodbye + end + + get '/date' do + erb :date + end + end diff --git a/views/date.erb b/views/date.erb new file mode 100644 index 0000000..f945a8f --- /dev/null +++ b/views/date.erb @@ -0,0 +1,4 @@ + + +

The date is<%=Date.today.strftime("%A, %B %d, %Y")%>

+ diff --git a/views/goodbye.erb b/views/goodbye.erb new file mode 100644 index 0000000..d81349a --- /dev/null +++ b/views/goodbye.erb @@ -0,0 +1,2 @@ +<% name = "Joe" %> +

Goodbye <%=name%>

diff --git a/views/hello.erb b/views/hello.erb new file mode 100644 index 0000000..05a166d --- /dev/null +++ b/views/hello.erb @@ -0,0 +1,5 @@ + + +

Hello World +

+