From 0cc9d36b44ac12305958784be7727a27f898ffff Mon Sep 17 00:00:00 2001 From: Kerboul Date: Thu, 24 Oct 2024 17:15:58 +0200 Subject: [PATCH] update api.js --- routes/api.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/routes/api.js b/routes/api.js index 6572c49..a68dd56 100644 --- a/routes/api.js +++ b/routes/api.js @@ -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) {