-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7aec87a
commit c73b290
Showing
17 changed files
with
108 additions
and
69 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# frozen_string_literal: true | ||
|
||
require "yaframework" | ||
app = Yaframework::Application | ||
|
||
app.get "/" do | ||
response.redirect "/html" | ||
end | ||
|
||
app.get "/html" do | ||
response.html "This is <b>HTML</b>, where you cat use some <small>tags</small>. | ||
<br/>JSON <a href=\"/json\">here</a>, | ||
<br/>Plain text <a href=\"/text\">here</a>" | ||
end | ||
|
||
app.get "/text" do | ||
response.text "Just plain text.<br/>Boring, even tags don't work..." | ||
end | ||
|
||
app.get "/json" do | ||
response.json "{ \"The awesomeness of this framework\": \"100/100\" }" | ||
end | ||
|
||
app.listen(4567) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# frozen_string_literal: true | ||
|
||
require "yaframework" | ||
app = Yaframework::Application | ||
|
||
app.get "/" do | ||
response.set_cookie("foo", "bar") | ||
"Your cookies, sir: #{response["Set-Cookie"]}.<br/>Go <a href=\"/delete\">here</a> to delete them" | ||
end | ||
|
||
app.get "/delete" do | ||
response.delete_cookie("foo") | ||
"Your cookies, sir: #{response["Set-Cookie"]}" | ||
end | ||
|
||
app.listen(4567) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# frozen_string_literal: true | ||
|
||
require "yaframework" | ||
app = Yaframework::Application | ||
|
||
app.get "/" do | ||
"This is the root, go somewhere else..<br/>Maybe <a href=\"/asdfg\">here</a>, idk" | ||
end | ||
|
||
app.handle 404 do | ||
"Hey, I just handled a 404 error!<br/>The dude from the previous page deceived you!" | ||
end | ||
|
||
app.handle 500 do | ||
"Error 500, this shouldn't have happened..." | ||
end | ||
|
||
app.listen(4567) |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# frozen_string_literal: true | ||
|
||
require "yaframework" | ||
app = Yaframework::Application | ||
|
||
app.get "/" do | ||
request[:username] = "IVAN!" | ||
"Now 'request[:username]': #{request[:username]} contains in 'request.params': #{request.params}" | ||
end | ||
|
||
app.listen(4567) |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.