@increase21/simplenodejs 2.0.1 → 2.0.3

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.
package/README.md CHANGED
@@ -98,7 +98,7 @@ Controllers are auto-loaded from `controllersDir` at startup. The file path maps
98
98
  ```
99
99
  controllers/
100
100
  drivers/
101
- auths.ts → /users/auths
101
+ auths.ts → /drivers/auths
102
102
 
103
103
  customers/
104
104
  auths.ts → /customers/auths
@@ -119,7 +119,7 @@ export default class AuthController {
119
119
  // single HTTP method — access this.ctx directly, no descriptor needed
120
120
  async login(): Promise<void> {
121
121
  if (this.ctx.method !== "post") return this.ctx.res.status(405).json({ error: "Method Not Allowed" });
122
- // handler logic...
122
+ // other logic...
123
123
  }
124
124
 
125
125
  // multiple HTTP methods — return a SimpleJsEndpoint array
package/dist/router.js CHANGED
@@ -52,7 +52,7 @@ async function route(req, res) {
52
52
  return (0, helpers_1.throwHttpError)(404, "Resource not found");
53
53
  //also add the context to the controller instance so that it can be accessed in the methods without passing it as a parameter
54
54
  controller.ctx = ctx;
55
- const descriptors = await controller[methodName](ctx, ...id);
55
+ const descriptors = await controller[methodName](...id);
56
56
  // If the controller method has already sent a response, do not proceed
57
57
  if (res.writableEnded)
58
58
  return;
package/package.json CHANGED
@@ -1,8 +1,12 @@
1
1
  {
2
2
  "name": "@increase21/simplenodejs",
3
- "version": "2.0.1",
3
+ "version": "2.0.3",
4
+ "homepage": "https://github.com/increase21/simplenodejs#readme",
5
+ "funding": {
6
+ "type": "github",
7
+ "url": "https://github.com/sponsors/increase21"
8
+ },
4
9
  "description": "Lightweight Node.js HTTP framework with middlewares and plugins",
5
- "dev": "dist/index.js",
6
10
  "bugs": "https://github.com/increase21/simplenodejs/issues",
7
11
  "main": "dist/index.js",
8
12
  "types": "dist/index.d.ts",
@@ -15,14 +19,13 @@
15
19
  },
16
20
  "repository": {
17
21
  "type": "git",
18
- "url": "https://github.com/increase21/simplenodejs.git",
19
- "directory": ""
22
+ "url": "git+https://github.com/increase21/simplenodejs.git"
20
23
  },
21
24
  "files": [
22
25
  "dist"
23
26
  ],
24
27
  "scripts": {
25
- "build": "tsc && npm publish",
28
+ "build": "tsc",
26
29
  "test": "node dist/test.js",
27
30
  "dev": "nodemon server.ts"
28
31
  },
@@ -34,10 +37,11 @@
34
37
  ],
35
38
  "author": "Increase Nkanta",
36
39
  "license": "MIT",
37
- "dependencies": {
40
+ "devDependencies": {
41
+ "typescript": "^5.3.0",
38
42
  "@types/node": "^20.0.0"
39
43
  },
40
- "devDependencies": {
41
- "typescript": "^5.3.0"
44
+ "engines": {
45
+ "node": ">=20"
42
46
  }
43
47
  }