This project provides a backend for managing devices illustrations and uploading images to Cloudinary.
- Go 1.16+
- Cloudinary account
- .env file with
CLOUDINARY_URLset
-
Clone the repository:
git clone git@github.com:ispapp/outsourced-cdn-cli.git cd outsourced-cdn-cli -
Install dependencies:
go mod tidy
-
Create a
.envfile with your Cloudinary URL:echo "CLOUDINARY_URL=cloudinary://<api_key>:<api_secret>@<cloud_name>" > .env
To upload images to Cloudinary, use the upload command:
go run main.go upload --input path/to/input.json --folder cloudinary-folder --output path/to/cdn.db --envTo serve images and proxy output JSON with fast search, use the serve command:
go run main.go serve --input path/to/cdn.db in case of cloudflared tunnel setup you need to follow the steps below:
- install cloudflared
- check the official documentation for the setup link.
- save the config.yml file in the root directory of the project
- run the following command:
go run main.go serve --input path/to/cdn.db --cfd-config config.ymlTo run the tests, use the following command:
go test -vThis will run the tests defined in main_test.go to ensure the CLI commands are working correctly.