badmfck-api-server 1.2.8 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -111,7 +111,7 @@ class APIService extends BaseService_1.BaseService {
111
111
  if (!i.endpoints)
112
112
  continue;
113
113
  for (let j of i.endpoints) {
114
- const ep = j.endpoint;
114
+ const ep = BaseEndpoint_1.BaseEndpoint.getEntryPoint() + j.endpoint;
115
115
  app.all(ep, async (req, res) => {
116
116
  const tme = +new Date();
117
117
  let log = null;
@@ -34,7 +34,7 @@ class BaseEndpoint {
34
34
  i.endpoint = i.endpoint.substring(1);
35
35
  if (i.endpoint.endsWith("/"))
36
36
  i.endpoint = i.endpoint.substring(0, i.endpoint.length - 1);
37
- i.endpoint = BaseEndpoint.entrypoint + this.endpoint + i.endpoint;
37
+ i.endpoint = this.endpoint + i.endpoint;
38
38
  }
39
39
  this.endpoints = endpoints;
40
40
  }
@@ -50,7 +50,7 @@ class BaseEndpoint {
50
50
  async execute(req) {
51
51
  if (this.endpoints && this.endpoints.length > 0) {
52
52
  for (let i of this.endpoints) {
53
- if (i.endpoint === req.endpoint)
53
+ if (BaseEndpoint.entrypoint + i.endpoint === req.endpoint)
54
54
  return i.handler(req);
55
55
  }
56
56
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "badmfck-api-server",
3
- "version": "1.2.8",
3
+ "version": "1.3.0",
4
4
  "description": "Simple API http server based on express",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",