-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(app.js): add validation for invalid URL and return appropriate er…
…ror response fix(app.js): handle case when DB_JSON_PATH is not found and return appropriate error response fix(app.js): handle case when db is not found in MongoDB and return appropriate error response fix(app.js): add validation for custom code already existing and return appropriate error response fix(app.js): redirect to error page if shorten response does not contain shorten data feat(app.js): add support for custom_code parameter to allow users to specify their own short code fix(app.js): fix indentation in console.log statement feat(package.json): update version to 1.0.7 feat(public/index.html): add script to display error message if present in URL parameters
- Loading branch information
Showing
3 changed files
with
36 additions
and
10 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
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 |
---|---|---|
|
@@ -5,14 +5,25 @@ | |
<title>Quecto</title> | ||
|
||
<link rel="stylesheet" href="/public/style.css"> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/base64.min.js"></script> | ||
</head> | ||
<body> | ||
<form action="/api/form_shorten" method="post"> | ||
<div class="content"> | ||
<input type="text" name="link" placeholder="Link" required> | ||
<input type="password" name="password" placeholder="Password"> <br> | ||
<input type="text" name="custom_code" placeholder="Custom Short Code"> <br> | ||
<input type="submit" value="Shorten"> | ||
</div> | ||
</form> | ||
|
||
<script> | ||
window.onload = () => { | ||
const searchParams = new URLSearchParams(window.location.search); | ||
const error = searchParams.get('error'); | ||
if (!error) return; | ||
alert(Base64.decode(error)); | ||
} | ||
</script> | ||
</body> | ||
</html> |