badmfck-api-server 1.4.7 → 1.4.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -31,6 +31,13 @@ class BaseEndpoint {
31
31
  }
32
32
  registerEndpoints(endpoints) {
33
33
  for (let i of endpoints) {
34
+ if (i.endpoint === "" || i.endpoint === "/") {
35
+ let empty = i.endpoint === "";
36
+ i.endpoint = this.endpoint;
37
+ if (i.endpoint.endsWith("/") && empty)
38
+ i.endpoint = i.endpoint.substring(0, i.endpoint.length - 1);
39
+ continue;
40
+ }
34
41
  if (i.endpoint.startsWith("/"))
35
42
  i.endpoint = i.endpoint.substring(1);
36
43
  if (i.endpoint.endsWith("/"))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "badmfck-api-server",
3
- "version": "1.4.7",
3
+ "version": "1.4.8",
4
4
  "description": "Simple API http server based on express",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",