use env for url

This commit is contained in:
keyan 2021-07-07 19:45:02 -05:00
parent 11f3654f1e
commit 248f5a9967
1 changed files with 1 additions and 1 deletions

View File

@ -2,7 +2,7 @@ import Pageres from 'pageres'
import path from 'path'
export default async function handler (req, res) {
const url = 'http://' + path.join('localhost:3000', ...(req.query.path || []))
const url = process.env.SELF_URL + '/' + path.join(...(req.query.path || []))
res.setHeader('Content-Type', 'image/png')
const streams = await new Pageres({ crop: true, delay: 1 })
.src(url, ['600x300'])