http2cdn 🏵
CDN management service for http2server
/http2live
.
Usage
http2cdn <configuration>
Where <configuration>
is the path to a file containing the configuration options. It can be JavaScript or JSON.
Configuration
Example: cdn.conf.js
const tmpdir = const join = moduleexports = // Top level domain for automatically generated subdomains wildcard: 'http2.live' // Directory where uploaded files will be stored before processing upload: // Directory where public files will be stored public: // PostgreSQL connection string DATABASE_URL: 'postgres://seb@localhost/http2live' // Base configuration JSON file for http2server file: // Runtime of http2server bin: // Authentication details provided by Auth0 jwt: jwksUri: 'https://http2.au.auth0.com/.well-known/jwks.json' audience: 'https://http2.live/' issuer: 'https://http2.au.auth0.com/' // Port to accept incoming connections port: 8888 // TLS credentials crypto: key: cert: ca:
API
GET /
Shows a dummy index.html
upload form. Broken at the moment. Use http2live
instead.
POST /upload
Receives uploaded directory of static files and server host configuration.
Returns 200
upon success with a JSON object containing the published domain.
Errors are shown as 421
.
directory
Field Upload one or more files with the same field name. The filename may contain a relative path, as per the webkitdirectory
attribute.
options
Field JSON object containing valid http2configuration
settings. The first host is associated with the deployed directory. Any other hosts are ignored.