Skip to content

Tricked-dev/image-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Image API

Create a api for images with Cloudflare pages and Bun.

Live demo https://borzoi-1am.pages.dev/

Getting started

You will need Bun installed and a Cloudflare account.

  1. Create a repo with this as a template and clone it locally
  2. 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
  3. Delete data.json and empty the images folder
  4. Drop images into the images folder
  5. (optional) Run bun run src/build.ts this will create a data.json file in which you can tag images and change the output name.
  6. Go to Cloudflare to the pages tab click create new application
  7. Click on Pages -> Connect to git
  8. Select the created repo
  9. As command set bun run build
  10. Output folder is ./dist
  11. And you're done!

Debugging

Something went wrong installing the "sharp" module

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

Customizing

You can customize the look and stuff by editing the pug templates inside src/ui

Contributing

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!

License

MIT

About

Create a random image api for free!

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published

Contributors 2

  •  
  •