update api.js

This commit is contained in:
2024-10-24 17:15:58 +02:00
parent d2549f097b
commit 0cc9d36b44

View File

@@ -302,6 +302,9 @@ router.post('/delete', (req, res) => {
* description: Image not found
*/
router.get('/smile', (req, res) => {
res.setHeader('Access-Control-Allow-Origin', 'http://localhost:5500');
res.setHeader('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE');
res.setHeader('Access-Control-Allow-Headers', 'Content-Type');
const imagePath = path.join(__dirname, '../storage/smile.jpg');
fs.access(imagePath, fs.constants.F_OK, (err) => {
if (err) {