feat: centralize the base url config in frontend js part

This commit is contained in:
Nayan Hossain 2025-05-08 22:07:48 +06:00
parent e473c9e5c8
commit 8e918eb02a
4 changed files with 13 additions and 4 deletions

3
frontend/config.js Normal file
View File

@ -0,0 +1,3 @@
export const config = {
baseURL: "http://localhost:8080"
};

View File

@ -1,4 +1,6 @@
const baseUrl = "http://localhost:8080/dashboard.php"; import { config } from "../config";
const baseUrl = `${config.baseURL}/dashboard.php`;
export function dashboardApp() { export function dashboardApp() {
return { return {

View File

@ -1,5 +1,7 @@
const baseUrl = "http://localhost:8080/invoice.php"; import { config } from "../config";
const menuBaseUrl = "http://localhost:8080/menu.php";
const baseUrl = `${config.baseURL}/invoice.php`;
const menuBaseUrl = `${config.baseURL}/menu.php`;
export function invoiceApp() { export function invoiceApp() {
return { return {

View File

@ -1,4 +1,6 @@
const baseUrl = "http://localhost:8080/menu.php"; import { config } from "../config";
const baseUrl = `${config.baseURL}/menu.php`;
export function menuApp() { export function menuApp() {
return { return {