diff --git a/template/server/src/app.js b/template/server/app/config.js similarity index 98% rename from template/server/src/app.js rename to template/server/app/config.js index 5755b63b..5ebf8e83 100644 --- a/template/server/src/app.js +++ b/template/server/app/config.js @@ -84,8 +84,8 @@ app.use( /* ************************************************************************* */ -// Import the API routes from the router module -const apiRouter = require("./api/router"); +// Import the API routes +const apiRouter = require("./routers/api/router"); // Mount the API routes under the "/api" endpoint app.use("/api", apiRouter); diff --git a/template/server/src/controllers/itemActions.js b/template/server/app/controllers/itemActions.js similarity index 100% rename from template/server/src/controllers/itemActions.js rename to template/server/app/controllers/itemActions.js diff --git a/template/server/src/api/items/router.js b/template/server/app/routers/api/items/router.js similarity index 88% rename from template/server/src/api/items/router.js rename to template/server/app/routers/api/items/router.js index df11dc57..f2c198fe 100644 --- a/template/server/src/api/items/router.js +++ b/template/server/app/routers/api/items/router.js @@ -7,7 +7,7 @@ const router = express.Router(); /* ************************************************************************* */ // Import item-related actions -const { browse, read, add } = require("../../controllers/itemActions"); +const { browse, read, add } = require("../../../controllers/itemActions"); // Route to get a list of items router.get("/", browse); diff --git a/template/server/src/api/router.js b/template/server/app/routers/api/router.js similarity index 100% rename from template/server/src/api/router.js rename to template/server/app/routers/api/router.js diff --git a/template/server/src/services/.gitkeep b/template/server/app/services/.gitkeep similarity index 100% rename from template/server/src/services/.gitkeep rename to template/server/app/services/.gitkeep diff --git a/template/server/index.js b/template/server/index.js index 46c47f37..c8700222 100644 --- a/template/server/index.js +++ b/template/server/index.js @@ -2,7 +2,7 @@ require("dotenv").config(); // Import the Express application from src/app.js -const app = require("./src/app"); +const app = require("./app/config"); // Get the port from the environment variables const port = process.env.APP_PORT;