diff --git a/index.js b/index.js index 6b597d5..fa1d4cd 100644 --- a/index.js +++ b/index.js @@ -1,3 +1,5 @@ +require('dotenv').config(); + const express = require('express'); const path = require('path'); const bodyParser = require('body-parser'); @@ -21,7 +23,7 @@ app.post('/', uploadMiddleware, (req, res) => { res.json({ success: true, message: 'Success upload file', - urlImage: `https://img-resize-xxx.herokuapp.com/public/${req.file.filename}`, + urlImage: `${process.env.ORIGIN}/public/${req.file?.filename}`, }); }); diff --git a/package.json b/package.json index 86bc250..9029878 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ "license": "ISC", "dependencies": { "body-parser": "^1.19.2", + "dotenv": "^16.0.3", "express": "^4.17.3", "multer": "^1.4.4", "sharp": "^0.28.3" diff --git a/public/index.html b/public/index.html index e0fabeb..b2a6e66 100644 --- a/public/index.html +++ b/public/index.html @@ -133,24 +133,12 @@
- +
- - + +
@@ -179,9 +167,7 @@
- +