Static service tool using Deno (esbuild & live-reloading), Ngrok, Certbot and Cloudflare
- Deno is used to create a static file server (including esbuild & live-reloading)
- Ngrok is used to tunnel this server to any specified domain
- Certbot is used to issue a TLS/SSL certificate for the specified domain
- Cloudflare is used for DNS service
You must first have Deno, Ngrok and Certbot installed on your device.
It is also required that you use Cloudflare as your DNS for your domain.
You'll need to have a certbot-dns-cloudflare installed as a plugin for Certbot.
A wildcard domain (e.g. *.example.io) needs to be added to your Ngrok domains and the corresponding CNAME to your Cloudflare DNS records before usage.
Download this respository, and run the following script in your terminal:
./setup.sh
The setup script will guide you through the setup process.
Once setup, spstic can be ran via terminal in any directory to spin up a static service
# The command `spstic`, `spastic` or `static` can be used from terminal
# Deploy a static service from this directory
spstic
# Deploy a static service from this directory on the specfied subdomain (e.g. xyz123)
spstic --subdomain=[subdomain]
# Deploy a static service from this directory on the specfied port (e.g. 8080)
spstic --port=[port]
# Deploy a static service from this directory without Certbot or Ngrok
spstic --local
# Configure the credentials
spstic --configure
# Show the help
spstic --help
Any required TLS/SSL certificates will be generated and uploaded.
The web address for your service will be displayed in the terminal.
Any JavaScript/JSX files will be minified and transpiled as ES Modules with esbuild.
Any changes made to files in your directory will be live-reloaded.
Copyright (c) 2022-present, Daniel Larkin