Skip to content

Instantly share code, notes, and snippets.

@thedoritos
Last active April 28, 2021 11:45
Show Gist options
  • Save thedoritos/91b086e46ea6da7c943b8fe4e910a22c to your computer and use it in GitHub Desktop.
Save thedoritos/91b086e46ea6da7c943b8fe4e910a22c to your computer and use it in GitHub Desktop.
URL Scheme Testing Template
#!/bin/bash
STATIC_PAGE_URL=$1
mkdir -p public
if [[ ! -f public/index.html ]]; then curl $STATIC_PAGE_URL > public/index.html; fi
ruby -run -e httpd ./public -p 8000
<!DOCTYPE html>
<html>
<head>
<title>URL Schemes</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<h3>customscheme://</h3>
<p><a href="customscheme://login">Login</a></p>
<p><a href="customscheme://screen1">Screen 1</a></p>
<p><a href="customscheme://screen2?param1=value1">Screen 2</a></p>
</body>
</html>
@thedoritos
Copy link
Author

What is this?

Tiny script to launch httpd to test links with custom URL scheme.

How to use

  1. Copy launch.sh and add permissions
  2. Run launch.sh with an argument pointing a static html (for example, use template.html)
  3. Open localhost:8000 with a browser

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment