Skip to content

Instantly share code, notes, and snippets.

@surajsau
Created April 28, 2021 12:48
Show Gist options
  • Save surajsau/f5179918aeb73e454a1bd122890ef237 to your computer and use it in GitHub Desktop.
Save surajsau/f5179918aeb73e454a1bd122890ef237 to your computer and use it in GitHub Desktop.
Tiny script to launch httpd to test links with custom URL scheme (ref: https://gist.github.com/thedoritos/91b086e46ea6da7c943b8fe4e910a22c)
#!/bin/bash
# public/index.html
#
# <!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>
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment