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 hashes)

Uploaded Source

Built Distribution

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

Uploaded Python 3

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