Initial content
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.createCatalogRoutes = void 0;
|
||||
const data_1 = require("../data");
|
||||
const createCatalogRoutes = (app) => {
|
||||
app.get("/", async (req, resp) => {
|
||||
const products = await data_1.catalog_repository.getProducts();
|
||||
resp.render("index", { products });
|
||||
});
|
||||
// app.get("/err", (req, resp) => {
|
||||
// throw new Error ("Something bad happened");
|
||||
// });
|
||||
// app.get("/asyncerr", async (req, resp) => {
|
||||
// throw new Error ("Something bad happened asynchronously");
|
||||
// });
|
||||
};
|
||||
exports.createCatalogRoutes = createCatalogRoutes;
|
||||
@@ -0,0 +1,8 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.createRoutes = void 0;
|
||||
const catalog_1 = require("./catalog");
|
||||
const createRoutes = (app) => {
|
||||
(0, catalog_1.createCatalogRoutes)(app);
|
||||
};
|
||||
exports.createRoutes = createRoutes;
|
||||
Reference in New Issue
Block a user