📸 website screenshots as a service
PORT
- the port that the application will run (optional, defaults to 3000
)REDIS_URL
- the address of your redis database (required)⚠️- You can't change the provider when using the pre-built binaries.
sh
curl -fsSL https://raw.githubusercontent.com/devtomio/website-screenshot/main/install.sh
See the Releases page of this repository and download the appropriate binary.
⚠️- You can't change the provider when using the docker image.
A dockerized version of this application is available here.
Installing website-screenshot
as a crate.
sh
cargo install website-screenshot
git clone https://github.com/devtomio/website-screenshot
cargo build --release
📝 - This is the default provider.
sh
cargo build --release
📝 - You must make an unsigned upload preset.
CLOUDINARY_API_KEY
- your api key (required)CLOUDINARY_UPLOAD_PRESET
- the name of your unsigned upload preset (required)CLOUDINARY_CLOUD_NAME
- the cloud name that you set during registration (required)sh
cargo build --release --no-default-features --features cloudinary_provider
⚠️ - This is untested. If you encounter a bug please don't hesitate to open an issue.
S3_BUCKET_NAME
- the name of your s3 bucket (required)S3_REGION
- the region of your s3 bucket (required)S3_ACCESS_KEY
- your access key (required)S3_SECRET_KEY
- your secret key (required)S3_SECURITY_TOKEN
- your security token (optional)S3_SESSION_TOKEN
- your session token (optional)sh
cargo build --release --no-default-features --features s3_provider
TIXTE_UPLOAD_KEY
- your upload key, can be found on the integrations tab (required)TIXTE_DOMAIN_CONFIG
- whether to use random domains or a specific domain (required, can only be standard
, or random
)TIXTE_CUSTOM_DOMAIN
- the specific domain to use (only required when TIXTE_DOMAIN_CONFIG
is set to standard
)sh
cargo build --release --no-default-features --features tixte_provider
SLED_PATH
- the path to provide when opening the sled database (optional, defaults to .website-screenshot
)sh
cargo build --release --no-default-features --features sled_provider
/
Hello, world!
Example Response:
text
Hello, world!
/screenshot
Creates a screenshot.
JSON payload with the url
key.
Example Payload:
json
{
"url": "https://rust-lang.org"
}
Example Response
json
{
"slug": "abcdefghijk",
"path": "/s/abcdefghijk",
"metadata": {
"url": "https://rust-lang.org"
}
}
/s/:slug
Gets the screenshot that is corresponding to the slug.
Example URL
text
http://localhost:3000/s/abcdefghijk
Example Response
Licensed under either of
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
Thanks goes to these wonderful people (emoji key):
Tomio 💻 📖 🚇 🚧 |
This project follows the all-contributors specification. Contributions of any kind welcome!