Closed sbonilla-godaddy closed 1 month ago
Hi @sbonilla-godaddy, this project contains only image codec libraries. These libraries allow images to be encoded or decoded in the Web Browser with JavaScript.
What are you wanting to host with the CDN? Is it Images?
You'll need to research and find the appropriate service to do that. I can recommend Cloudflare, as they have a free service that can automatically cache and host images on your web domains.
I'll close this issue as I don't think it's relevant. Best of luck with your project!
Hi @jamsinclair I mean I cdn like this one https://unpkg.com/@jsquash/jpeg?module
but I want to host in my server
example:
https://myserver.com/@jsquash/jpeg?module
The code for that "Content Delivery Network" is open source and can be found at https://github.com/mjackson/unpkg.
At its simplest you could host the static files directly on your server. It's the building blocks of web technology. Then you could import the scripts directly in your JavaScript files. e.g.
import { encode } from 'https://myserver.com/@jsquash/jpeg/index.js'
The question is, do you really need to? If it's for personal use you would be better off bundling the assets with a tool like vite or webpack for your project, or consume the existing CDN.
Unfortunately, we're a bit off topic for this project. I don't think I can offer much more guidance. I think those resources should definitely help you in your learning and understanding. Good luck!
How can I create and host my own CDN version on my server?