Create a api for images with Cloudflare pages and Bun.
Live demo https://borzoi-1am.pages.dev/
You will need Bun installed and a Cloudflare account.
- Create a repo with this as a template and clone it locally
- Edit branding.json to add a description, title and possible change the format used png is used by default and gifs will stay gifs (png,webp,jpg) are all accepted formats
- Delete data.json and empty the images folder
- Drop images into the images folder
- (optional) Run
bun run src/build.tsthis will create adata.jsonfile in which you can tag images and change the output name. - Go to Cloudflare to the pages tab click create new application
- Click on Pages -> Connect to git
- Select the created repo
- As command set
bun run build - Output folder is
./dist - And you're done!
I tried making a permanent fix but it didn't work so for now you can fix it by removing the node_modules and bun.lockb folders at the same time
rm -rf bun.lockb node_modules
And doing bun i again
You can customize the look and stuff by editing the pug templates inside src/ui
Feel free to add new borzoi's for this kind of demo but also borzoi api!
Any pull requests are welcome! even if its as small as fixing typos or as big as redesign!
MIT