add origin and AppRouter
This commit is contained in:
parent
cdd3c08d53
commit
367f82e7bf
2 changed files with 6 additions and 2 deletions
|
|
@ -7,7 +7,11 @@ import { postgresServices } from './services/postgres/postgresServices.js';
|
||||||
const app = express();
|
const app = express();
|
||||||
|
|
||||||
const corsOptions = {
|
const corsOptions = {
|
||||||
origin: ["http://localhost:5173"]
|
origin: [
|
||||||
|
"http://localhost:5173",
|
||||||
|
"https://shift-dev.code-catalyst.com",
|
||||||
|
"https://shift.code-catalyst.com"
|
||||||
|
]
|
||||||
};
|
};
|
||||||
|
|
||||||
app.use(cors(corsOptions));
|
app.use(cors(corsOptions));
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,7 @@ const AppRouter = () => {
|
||||||
|
|
||||||
const fetchAPI = async () => {
|
const fetchAPI = async () => {
|
||||||
const location = window.location;
|
const location = window.location;
|
||||||
const uri = `192.168.0.105:5172/api`;
|
const uri = `/api`;
|
||||||
const response = await axios.get(uri);
|
const response = await axios.get(uri);
|
||||||
console.log(response.data.fruits);
|
console.log(response.data.fruits);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue