This repository has been archived by the owner on Feb 28, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(status_pages): create default success and error pages for starte…
…rs (#443)
- Loading branch information
1 parent
ea84dce
commit df4a00b
Showing
10 changed files
with
293 additions
and
2 deletions.
There are no files selected for viewing
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,12 @@ | ||
import LoggerAPI | ||
|
||
func initializeErrorRoutes(app: App) { | ||
app.router.all { request, response, _ in | ||
if response.statusCode == .unknown { | ||
let path = request.urlURL.path | ||
if path != "/" && path != "" { | ||
try response.status(.notFound).redirect("/404.html") | ||
} | ||
} | ||
} | ||
} |
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,22 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
|
||
<head> | ||
<title>IBM Cloud Web Starter</title> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<link inline rel="stylesheet" href="css/default.css"></link> | ||
</head> | ||
|
||
<body> | ||
<div> | ||
<div id="error-container"> | ||
<div> | ||
<div class="sad-cloud" ></div> | ||
<h1>404!</h1> | ||
<h2>Whoops! Looks like you got lost or couldn't find your page.</h2> | ||
<h2>Click to go to the <a href="https://developer.ibm.com/swift/" target="_blank">overview page</a>.</h2> | ||
</div> | ||
</div> | ||
</div> | ||
</body> | ||
</html> |
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,22 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
|
||
<head> | ||
<title>IBM Cloud Web Starter</title> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<link inline href="css/default.css" rel="stylesheet" /> | ||
</head> | ||
|
||
<body> | ||
<div> | ||
<div id="error-container"> | ||
<div> | ||
<div class="sad-cloud"></div> | ||
<h1>Uh oh!</h1> | ||
<h2>Whoops! The server couldn't handle your request.</h2> | ||
<h2>Click to go to the <a href="https://developer.ibm.com/swift/" target="_blank">overview page</a>.</h2> | ||
</div> | ||
</div> | ||
</div> | ||
</body> | ||
</html> |
Large diffs are not rendered by default.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,67 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
|
||
<head> | ||
<title>IBM Cloud Web Starter</title> | ||
<link inline href="css/default.css" rel="stylesheet" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
</head> | ||
|
||
<body> | ||
<header id="flex-header"> | ||
<div class="cloud-header"></div> | ||
<h1>Congratulations!</h1> | ||
|
||
<h2>You are currently running a Swift app built for the IBM Cloud.</h2> | ||
</script> | ||
</header> | ||
<main> | ||
<ul> | ||
|
||
<li> | ||
<div class="right-arrow"></div> | ||
<div> | ||
<a target="_blank" href="https://console.bluemix.net/developer/appservice/dashboard">App Services on IBM Cloud</a> | ||
</div> | ||
</li> | ||
|
||
<li> | ||
<div class="right-arrow"></div> | ||
<div> | ||
<a target="_blank" href="https://developer.ibm.com/swift">Visit the Swift Developer Center</a> | ||
</div> | ||
</li> | ||
|
||
<li> | ||
<div class="right-arrow"></div> | ||
<div> | ||
<a target="_blank" href="https://swift-at-ibm-slack.mybluemix.net/">Join the discussion on Slack</a> | ||
</div> | ||
</li> | ||
|
||
<li> | ||
<div class="right-arrow"></div> | ||
<div> | ||
<a target="_blank" href="https://developer.ibm.com/swift/guides/">Checkout tutorials for Swift</a> | ||
</div> | ||
</li> | ||
|
||
<li> | ||
<div class="right-arrow"></div> | ||
<div> | ||
<a target="_blank" href="https://www.ibm.com/cloud/cli">Try out the IBM Cloud Developer Tools</a> | ||
</div> | ||
</li> | ||
|
||
<li> | ||
<div class="right-arrow"></div> | ||
<div> | ||
<a target="_blank" href="http://www.kitura.io/">Visit Kitura.io</a> | ||
</div> | ||
</li> | ||
|
||
</ul> | ||
</main> | ||
</body> | ||
|
||
</html> |
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