Hours ago I was searching for a way to host "raw" (with raw I mean an endpoint that returns an image) and most of them like azure blob storage are paid so I searched for free alternatives.
GitHub
- Create a new repo
- Upload files
- Drag your image
- On the image page, right-click it and click 'copy image link'
Telegra.ph
To host the images in the telegram server
- Go to telegra.ph
- Click on the camera icon and choose your image
- Right-click the image and 'copy image link'
You also can use the API using for example telegram-uploader.
Here's a snippet of how to use it
const { uploadByBuffer } = require('telegraph-uploader')
const fs = require('fs')
uploadByBuffer(fs.readFileSync('./image.png'), 'image/png')
.then((result) => {
console.log(result)
/* {
link: 'https://telegra.ph/file/...',
path: '/file/...',
} */
})
Sirv.com
It's a more advanced hosting, it provides benefits like
- Custom domain
- Folders
- Custom name
- Custom endpoint but also as it is a professional option it have limitations for the free plan, for example it only allow you to host 500mb for free and have a bandwidth of 2GB.
Thanks for reading :)
Top comments (1)
Cool tips!