https://github.com/tricked-dev/image-api
Create a random image api for free!
https://github.com/tricked-dev/image-api
cloudflare-pages
Last synced: about 1 year ago
JSON representation
Create a random image api for free!
- Host: GitHub
- URL: https://github.com/tricked-dev/image-api
- Owner: Tricked-dev
- License: mit
- Created: 2023-11-18T12:00:52.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-11-18T22:56:09.000Z (over 2 years ago)
- Last Synced: 2025-01-16T10:17:18.886Z (about 1 year ago)
- Topics: cloudflare-pages
- Language: TypeScript
- Homepage: https://borzoi-1am.pages.dev/
- Size: 7.38 MB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Image API
Create a api for images with [Cloudflare pages](https://pages.cloudflare.com) and [Bun](https://bun.sh/).
Live demo
## Getting started
You will need Bun installed and a Cloudflare account.
1. Create a repo with this as a template and clone it locally
1. 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
1. Delete data.json and empty the images folder
1. Drop images into the images folder
1. (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.
1. Go to Cloudflare to the [pages tab](https://dash.cloudflare.com/?to=/:account/workers-and-pages) click create new application
1. Click on Pages -> Connect to git
1. Select the created repo
1. As command set `bun run build`
1. Output folder is `./dist`
1. 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