the server
import app from "../firebase/firebaseCon";
import analytics from "../firebase/firebaseCon";
const express = require("express");
const ex = express();
ex.get("/store", (req, res) => {
const store = [
{ id: 1, firstname: "hamdan" },
{ id: 1, firstname: "hamdan" },
{ id: 1, firstname: "hamdan" },
];
res.json(store);
});
ex.listen(5000, () => {
console.log("hello");
});
the firebase
import { initializeApp } from "firebase/app";
import { getAnalytics } from "firebase/analytics";
const firebaseConfig = {
apiKey: "",
authDomain: "",
projectId: "",
storageBucket: "",
messagingSenderId: "",
appId: "",
measurementId: "",
};
export const app = initializeApp(firebaseConfig);
export const analytics = getAnalytics(app);
both of the codes above are in separate files whenever i try to require or import the firebase file into the server i get an error and the app stops not that much description in the error it only says that there is an internal error
the error
App.js:14 GET http://localhost:3000/store 500 (Internal Server Error)
componentDidMount @ App.js:14
commitLayoutEffectOnFiber @ react-dom.development.js:23305
commitLayoutMountEffects_complete @ react-dom.development.js:24688
commitLayoutEffects_begin @ react-dom.development.js:24674
commitLayoutEffects @ react-dom.development.js:24612
commitRootImpl @ react-dom.development.js:26823
commitRoot @ react-dom.development.js:26682
finishConcurrentRender @ react-dom.development.js:25981
performConcurrentWorkOnRoot @ react-dom.development.js:25809
workLoop @ scheduler.development.js:266
flushWork @ scheduler.development.js:239
performWorkUntilDeadline @ scheduler.development.js:533
proxy problem
Could not proxy request /store from localhost:3000 to http://localhost:5000/.