@spinajs/http 2.0.57 → 2.0.58
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/lib/config/http.d.ts +50 -1
- package/lib/config/http.d.ts.map +1 -1
- package/lib/config/http.js +3 -2
- package/lib/config/http.js.map +1 -1
- package/package.json +10 -10
package/lib/config/http.d.ts
CHANGED
|
@@ -1,2 +1,51 @@
|
|
|
1
|
-
|
|
1
|
+
declare const http: {
|
|
2
|
+
system: {
|
|
3
|
+
dirs: {
|
|
4
|
+
locales: string[];
|
|
5
|
+
templates: string[];
|
|
6
|
+
controllers: string[];
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
cookie: {
|
|
10
|
+
secret: string;
|
|
11
|
+
options: {
|
|
12
|
+
maxAge: number;
|
|
13
|
+
httpOnly: boolean;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
http: {
|
|
17
|
+
port: number;
|
|
18
|
+
middlewares: any[];
|
|
19
|
+
/**
|
|
20
|
+
* Default file receiving options
|
|
21
|
+
*/
|
|
22
|
+
Files: {
|
|
23
|
+
MaxSize: number;
|
|
24
|
+
BasePath: string;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Static files folder. Feel free to override this per app
|
|
28
|
+
*/
|
|
29
|
+
Static: {
|
|
30
|
+
/**
|
|
31
|
+
* virtual prefix in url eg. http://localhost:3000/static/images/kitten.jpg
|
|
32
|
+
*/
|
|
33
|
+
Route: string;
|
|
34
|
+
/**
|
|
35
|
+
* full path to folder with static content
|
|
36
|
+
*/
|
|
37
|
+
Path: string;
|
|
38
|
+
}[];
|
|
39
|
+
/**
|
|
40
|
+
* Whitch accept headers we support (default JSON & HTML)
|
|
41
|
+
*/
|
|
42
|
+
AcceptHeaders: number;
|
|
43
|
+
/**
|
|
44
|
+
* Last resort fatal error fallback template, embedded in code
|
|
45
|
+
* in case if we cannot render any static files
|
|
46
|
+
*/
|
|
47
|
+
FatalTemplate: string;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
export default http;
|
|
2
51
|
//# sourceMappingURL=http.d.ts.map
|
package/lib/config/http.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../src/config/http.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../src/config/http.ts"],"names":[],"mappings":"AA8BA,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;QA8BN;;WAEG;;;;;QAQH;;WAEG;;YAGC;;eAEG;;YAGH;;eAEG;;;QAKP;;WAEG;;QAGH;;;WAGG;;;CAgBN,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
package/lib/config/http.js
CHANGED
|
@@ -7,7 +7,7 @@ const cors = require('cors');
|
|
|
7
7
|
import { join, normalize, resolve } from 'path';
|
|
8
8
|
import { HttpAcceptHeaders } from '../interfaces.js';
|
|
9
9
|
function dir(path) {
|
|
10
|
-
return resolve(normalize(join(
|
|
10
|
+
return resolve(normalize(join(process.cwd(), path)));
|
|
11
11
|
}
|
|
12
12
|
const corsPath = resolve(normalize(join(process.cwd(), 'cors.json')));
|
|
13
13
|
const cOptions = require(corsPath);
|
|
@@ -24,7 +24,7 @@ const corsOptions = {
|
|
|
24
24
|
allowedHeaders: cOptions.allowedHeaders,
|
|
25
25
|
credentials: true,
|
|
26
26
|
};
|
|
27
|
-
|
|
27
|
+
const http = {
|
|
28
28
|
system: {
|
|
29
29
|
dirs: {
|
|
30
30
|
locales: [dir('./../locales')],
|
|
@@ -100,4 +100,5 @@ module.exports = {
|
|
|
100
100
|
</html>`,
|
|
101
101
|
},
|
|
102
102
|
};
|
|
103
|
+
export default http;
|
|
103
104
|
//# sourceMappingURL=http.js.map
|
package/lib/config/http.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http.js","sourceRoot":"","sources":["../../src/config/http.ts"],"names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AG,IAAI;YAEpB,qFAAqF;YACrF,QAAQ,EAAE,GAAG,CAAC,oBAAoB,CAAC;SACpC;QAED;;WAEG;QACH,MAAM,EAAE;YACN;gBACE;;mBAEG;gBACH,KAAK,EAAE,SAAS;gBAEhB;;mBAEG;gBACH,IAAI,EAAE,GAAG,CAAC,YAAY,CAAC;aACxB;SACF;QAED;;WAEG;QACH,aAAa,EAAE,iBAAiB,CAAC,IAAI,GAAG,iBAAiB,CAAC,IAAI;QAE9D;;;WAGG;QACH,aAAa,EAAE;;;;;;;;;;;;;4BAaS;KACzB;CACF,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spinajs/http",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.58",
|
|
4
4
|
"description": "framework HTTP module base on express.js",
|
|
5
5
|
"exports": "./lib/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -52,15 +52,15 @@
|
|
|
52
52
|
"@types/uuid": "^9.0.0"
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"@spinajs/configuration": "^2.0.
|
|
56
|
-
"@spinajs/di": "^2.0.
|
|
57
|
-
"@spinajs/exceptions": "^2.0.
|
|
58
|
-
"@spinajs/fs": "^2.0.
|
|
59
|
-
"@spinajs/log": "^2.0.
|
|
60
|
-
"@spinajs/reflection": "^2.0.
|
|
61
|
-
"@spinajs/templates": "^2.0.
|
|
62
|
-
"@spinajs/validation": "^2.0.
|
|
63
|
-
"@spinajs/templates-pug": "^2.0.
|
|
55
|
+
"@spinajs/configuration": "^2.0.58",
|
|
56
|
+
"@spinajs/di": "^2.0.58",
|
|
57
|
+
"@spinajs/exceptions": "^2.0.58",
|
|
58
|
+
"@spinajs/fs": "^2.0.58",
|
|
59
|
+
"@spinajs/log": "^2.0.58",
|
|
60
|
+
"@spinajs/reflection": "^2.0.58",
|
|
61
|
+
"@spinajs/templates": "^2.0.58",
|
|
62
|
+
"@spinajs/validation": "^2.0.58",
|
|
63
|
+
"@spinajs/templates-pug": "^2.0.58",
|
|
64
64
|
"compression": "^1.7.4",
|
|
65
65
|
"cookie-parser": "^1.4.6",
|
|
66
66
|
"cookie-signature": "^1.2.0",
|