@ne1410s/xprest
Advanced tools
Comparing version 0.0.3 to 0.0.4
@@ -51,7 +51,7 @@ 'use strict'; | ||
* @param apiRoute The api route. | ||
* @param localPath The local file path. | ||
* @param localPath The file path, relative to the cwd. | ||
*/ | ||
Xprest.prototype.resource = function (apiRoute, localPath) { | ||
this.api['get'](apiRoute, function (_req, res) { | ||
res.sendFile(path.resolve(__dirname, localPath)); | ||
res.sendFile(path.resolve(process.cwd(), localPath)); | ||
}); | ||
@@ -62,3 +62,3 @@ }; | ||
* @param apiRoute The api route. | ||
* @param localPath The local file path. | ||
* @param localPath The file path, relative to the cwd. | ||
* @param variables Exposed in the rendering of the file. For example: | ||
@@ -69,3 +69,3 @@ * <%= new Date().getTime() * myVar.myProp %> | ||
this.api['get'](apiRoute, function (_req, res) { | ||
res.render(path.resolve(__dirname, localPath), variables); | ||
res.render(path.resolve(process.cwd(), localPath), variables); | ||
}); | ||
@@ -72,0 +72,0 @@ }; |
@@ -45,7 +45,7 @@ import cors from 'cors'; | ||
* @param apiRoute The api route. | ||
* @param localPath The local file path. | ||
* @param localPath The file path, relative to the cwd. | ||
*/ | ||
Xprest.prototype.resource = function (apiRoute, localPath) { | ||
this.api['get'](apiRoute, function (_req, res) { | ||
res.sendFile(resolve(__dirname, localPath)); | ||
res.sendFile(resolve(process.cwd(), localPath)); | ||
}); | ||
@@ -56,3 +56,3 @@ }; | ||
* @param apiRoute The api route. | ||
* @param localPath The local file path. | ||
* @param localPath The file path, relative to the cwd. | ||
* @param variables Exposed in the rendering of the file. For example: | ||
@@ -63,3 +63,3 @@ * <%= new Date().getTime() * myVar.myProp %> | ||
this.api['get'](apiRoute, function (_req, res) { | ||
res.render(resolve(__dirname, localPath), variables); | ||
res.render(resolve(process.cwd(), localPath), variables); | ||
}); | ||
@@ -66,0 +66,0 @@ }; |
@@ -7,3 +7,3 @@ export declare class Xprest { | ||
* @param apiRoute The api route. | ||
* @param localPath The local file path. | ||
* @param localPath The file path, relative to the cwd. | ||
*/ | ||
@@ -14,3 +14,3 @@ resource(apiRoute: string, localPath: string): void; | ||
* @param apiRoute The api route. | ||
* @param localPath The local file path. | ||
* @param localPath The file path, relative to the cwd. | ||
* @param variables Exposed in the rendering of the file. For example: | ||
@@ -17,0 +17,0 @@ * <%= new Date().getTime() * myVar.myProp %> |
{ | ||
"name": "@ne1410s/xprest", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "RESTful express core library", | ||
@@ -46,3 +46,2 @@ "main": "dist/ne14_xprest.cjs.min.js", | ||
"chai": "^4.2.0", | ||
"ejs": "^3.1.3", | ||
"mocha": "^8.0.1", | ||
@@ -58,2 +57,3 @@ "prettier": "^2.0.5", | ||
"cors": "^2.8.5", | ||
"ejs": "^3.1.3", | ||
"express": "^4.17.1", | ||
@@ -60,0 +60,0 @@ "jws": "^4.0.0" |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16301
12
5
+ Addedejs@^3.1.3
+ Addedansi-styles@4.3.0(transitive)
+ Addedasync@3.2.6(transitive)
+ Addedbalanced-match@1.0.2(transitive)
+ Addedbrace-expansion@1.1.112.0.1(transitive)
+ Addedchalk@4.1.2(transitive)
+ Addedcolor-convert@2.0.1(transitive)
+ Addedcolor-name@1.1.4(transitive)
+ Addedconcat-map@0.0.1(transitive)
+ Addedejs@3.1.10(transitive)
+ Addedfilelist@1.0.4(transitive)
+ Addedhas-flag@4.0.0(transitive)
+ Addedjake@10.9.2(transitive)
+ Addedminimatch@3.1.25.1.6(transitive)
+ Addedsupports-color@7.2.0(transitive)