diff --git a/BACKEND/controllers/dataController.js b/BACKEND/controllers/dataController.js index d20a21d..9849eb8 100644 --- a/BACKEND/controllers/dataController.js +++ b/BACKEND/controllers/dataController.js @@ -19,7 +19,7 @@ const addData = async (req, res, next) => { const file = req.file; if(file){ //convert images into base 64 encoding - const img = fs.readFileSync("uploads/" + file.filename); + const img = fs.readFileSync("./uploads/" + file.filename); encode_image = img.toString('base64'); //create object to store data in the collection @@ -110,7 +110,7 @@ const editData = async (req, res, next) => { const file = req.file; if(file){ //convert images into base 64 encoding - const img = fs.readFileSync("uploads/" + file.filename); + const img = fs.readFileSync("./uploads/" + file.filename); encode_image = img.toString('base64'); //create object to store data in the collection diff --git a/BACKEND/server.js b/BACKEND/server.js index c4c6d6b..140aa8d 100644 --- a/BACKEND/server.js +++ b/BACKEND/server.js @@ -21,8 +21,8 @@ app.use(passport.initialize()); const cors = require('cors'); const corsOptions = { credentials:true, - origin:'https://recordit123.netlify.app', - //origin:'http://localhost:3000', + //origin:'https://recordit123.netlify.app', + origin:'http://localhost:3000', optionsSuccessStatus:220, }; app.use(cors(corsOptions)); diff --git a/start_page/src/api/axios.js b/start_page/src/api/axios.js index 5d2fe6b..0d97ede 100644 --- a/start_page/src/api/axios.js +++ b/start_page/src/api/axios.js @@ -8,6 +8,6 @@ import axios from 'axios'; * Variable Accessed: */ export default axios.create({ - //baseURL: 'http://localhost:8080' - baseURL: 'https://recordit123.herokuapp.com/' + baseURL: 'http://localhost:8080' + //baseURL: 'https://recordit123.herokuapp.com/' }); \ No newline at end of file