kaelum 1.8.4 → 1.8.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,5 @@
1
- const kaelum = require("kaelum");
1
+ import kaelum from "kaelum";
2
+ import { routes } from "./routes";
2
3
 
3
4
  const app = kaelum();
4
5
 
@@ -11,7 +12,6 @@ app.setConfig({
11
12
  });
12
13
 
13
14
  // Mount routes
14
- const { routes } = require("./routes");
15
15
  routes(app);
16
16
 
17
17
  // Health check endpoint
@@ -28,5 +28,3 @@ app.useErrorHandler({ exposeStack: false });
28
28
  // Start server
29
29
  const PORT = process.env.PORT || 4000;
30
30
  app.start(PORT);
31
-
32
- export {};
@@ -1,6 +1,5 @@
1
- const users = require("./controllers/usersController");
2
- const { authMock } = require("./middlewares/authMock");
3
- const { version } = require("../../package.json");
1
+ import * as users from "./controllers/usersController";
2
+ import { authMock } from "./middlewares/authMock";
4
3
 
5
4
  const routes = (app: any): void => {
6
5
  // Global middleware for /users path
@@ -29,7 +28,7 @@ const routes = (app: any): void => {
29
28
  // Metadata endpoint
30
29
  app.addRoute("/meta", {
31
30
  get: (req: any, res: any) =>
32
- res.json({ version, framework: "Kaelum" }),
31
+ res.json({ framework: "Kaelum" }),
33
32
  });
34
33
  };
35
34
 
@@ -1,4 +1,5 @@
1
- const kaelum = require("kaelum");
1
+ import kaelum from "kaelum";
2
+ import { routes } from "./routes";
2
3
 
3
4
  const app = kaelum();
4
5
 
@@ -11,7 +12,6 @@ app.setConfig({
11
12
  });
12
13
 
13
14
  // Register routes
14
- const { routes } = require("./routes");
15
15
  routes(app);
16
16
 
17
17
  // Health check endpoint
@@ -28,5 +28,3 @@ app.useErrorHandler({ exposeStack: false });
28
28
  // Start server
29
29
  const PORT = process.env.PORT || 3000;
30
30
  app.start(PORT);
31
-
32
- export {};
@@ -1,5 +1,5 @@
1
1
  // controllers/pagesController.ts
2
- const path = require("path");
2
+ import path from "path";
3
3
 
4
4
  // Uses process.cwd() so it resolves from the project root in both
5
5
  // development (tsx) and production (compiled dist/), since views/
@@ -1,5 +1,5 @@
1
- const pages = require("./controllers/pagesController");
2
- const { logger } = require("./middlewares/logger");
1
+ import * as pages from "./controllers/pagesController";
2
+ import { logger } from "./middlewares/logger";
3
3
 
4
4
  // Mock auth middleware
5
5
  const auth = (req: any, res: any, next: any): void => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kaelum",
3
- "version": "1.8.4",
3
+ "version": "1.8.5",
4
4
  "description": "A minimalist Node.js framework for building web pages and APIs with simplicity and speed.",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",