【发布时间】:2022-09-23 22:35:10
【问题描述】:
我正在制作一个 API,通过使用这样的 URL (http://localhost:3000/city/?name=encenadaport&width=200&height=200) 从数据库中获取图像 我编写了处理大小调整问题的代码和函数,问题是当我编写它给我的 URL 时 错误:ENOENT:没有这样的文件或目录,stat \'D:\\Programming\\Udacity_FWD\\Projects\\Image_Api\\assets\\thumbnail\\santamonica_300_200.png\' 当我重新运行它时 我认为它会在创建调整大小的图像之前发送响应我该怎么办 这是处理调整大小的部分
enter code here
imgResize(imageLoc, name as string, width, height, newLocation);
res.sendFile(`${newLocation}/${name}_${width}_${height}.png`);
标签: node.js typescript sharp