Skip to main content

CLI for Hosty.Page

Project description

Introduction

This documentation covers the usage of the Hosty.Page CLI

Installation

pip install hostypage

The CLI can be installed with pip

Quick start

# Create a new site
hostypage publish index.html

To publish a site on Hosty.Page, simply call hostypage publish, specifying a path to a local HTML or zip file. Once the Hosty.Page CLI uploads your file, it will deploy your files to a CDN and return a URL in the format https://randomstring.hosty.page. This site will be live for 24 hours, before it expires and will be removed.

Authentication

# Sending API key with single request:
hostypage publish --api_key myapikey [...args]
# Storing the API key locally for future re-use:
hostypage set-api-key myapikey

In order to use the premimum features of Hosty.Page, you will need to authenticate. For free users, there is no need to authorize requests. To obtain an API key, you'll need to register for an account at Hosty.Page.

Once you have created an account, you can view/change it on the Dashboard.

Once you have a valid API key, you can either send it with every single request to the API by passing the --api-key parameter, or store it locally using the set-api-key command.

More publishing options

Custom domains

# Publish to `randomstring.example.com`
hostypage publish index.html --domain example.com

If you have a custom domain, you can pass the --domain option to the CLI to publish your site to this domain.

Subdomains

# Publish to `customsubdomain.hosty.page`
hostypage publish index.html --subdomain customsubdomain

Similar to custom domains, it's also possible to publish to a specific subdomain using the Hosty.Page CLI, by simply passing the --subdomain argument.

It's also possible to combine the --subdomain and --domain parameters to specify exactly where you want your site to be published.

Expiry

# Change expiry to 1 week (168 hours)
hostypage publish index.html --expiry 168

# Site never expires
hostypage publish index.html --no-expiry

Hosty.Page lets you customize the expiry of your published sites, or to remove the expiry completely so that sites remain live until they are manually deleted. If you do not provide an expiry option, all published sites will expire and be deleted after 24 hours.

You can change the expiry duration by providing an expiry value, in hours, using the --expiry parameter.

To remove the expiry completely, you can pass the --no-expiry parameter.

You may not pass both the --expiry and --no-expiry fields simultaneously

API parameter reference

Command Parameter Pro account required? Description
set-api-key api_key No Stores the API key to your local config
publish file No The file to publish - Must be a HTML or zip file
publish --api_key No Passes the API key at the time of publishing
publish --subdomain Yes Specify the subdomain to publish to
publish --domain Yes Specify the domain to publish to
publish --expiry Yes The duration, in hours, before the site gets deleted
publish --no-expiry Yes Site will never expire

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hostypage-0.12.0.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

hostypage-0.12.0-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file hostypage-0.12.0.tar.gz.

File metadata

  • Download URL: hostypage-0.12.0.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.9.2

File hashes

Hashes for hostypage-0.12.0.tar.gz
Algorithm Hash digest
SHA256 a7d9b6000c3d3ba5ae3c7c76f145c19e49f7b4b7a1fe27b3a17980cbf33d8013
MD5 fd56c2bb4dda52a832e9e94e02675cf2
BLAKE2b-256 c028757d5b9359a194bf52ebcf5e067f22eff80a5ae901782ec0df7d2a264abd

See more details on using hashes here.

File details

Details for the file hostypage-0.12.0-py3-none-any.whl.

File metadata

  • Download URL: hostypage-0.12.0-py3-none-any.whl
  • Upload date:
  • Size: 4.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.9.2

File hashes

Hashes for hostypage-0.12.0-py3-none-any.whl
Algorithm Hash digest
SHA256 55f1d321707b513721ad36df15ba46e9fcfe9af6d3f9e9c560d971bd9dc35e88
MD5 059dcef5b532a2d46b2711543cca96fd
BLAKE2b-256 86d143130f24606ecb3dd53c63ccabc9351623f5085b150d30fe97399ef76775

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page