@pristine-ts/http 0.0.302 → 0.0.303
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/dist/lib/cjs/http.module.js +19 -2
- package/dist/lib/cjs/http.module.js.map +1 -1
- package/dist/lib/cjs/servers/file.http-server.js +177 -0
- package/dist/lib/cjs/servers/file.http-server.js.map +1 -0
- package/dist/lib/cjs/servers/servers.js +18 -0
- package/dist/lib/cjs/servers/servers.js.map +1 -0
- package/dist/lib/esm/http.module.js +20 -3
- package/dist/lib/esm/http.module.js.map +1 -1
- package/dist/lib/esm/servers/file.http-server.js +171 -0
- package/dist/lib/esm/servers/file.http-server.js.map +1 -0
- package/dist/lib/esm/servers/servers.js +2 -0
- package/dist/lib/esm/servers/servers.js.map +1 -0
- package/dist/types/http.module.d.ts +1 -0
- package/dist/types/servers/file.http-server.d.ts +7 -0
- package/dist/types/servers/servers.d.ts +1 -0
- package/package.json +4 -4
|
@@ -25,6 +25,7 @@ __exportStar(require("./errors/errors"), exports);
|
|
|
25
25
|
__exportStar(require("./interceptors/interceptors"), exports);
|
|
26
26
|
__exportStar(require("./interfaces/interfaces"), exports);
|
|
27
27
|
__exportStar(require("./options/options"), exports);
|
|
28
|
+
__exportStar(require("./servers/servers"), exports);
|
|
28
29
|
__exportStar(require("./utils/utils"), exports);
|
|
29
30
|
__exportStar(require("./wrappers/wrappers"), exports);
|
|
30
31
|
exports.HttpModule = {
|
|
@@ -32,13 +33,29 @@ exports.HttpModule = {
|
|
|
32
33
|
importModules: [logging_1.LoggingModule],
|
|
33
34
|
configurationDefinitions: [
|
|
34
35
|
{
|
|
35
|
-
parameterName:
|
|
36
|
+
parameterName: `%${http_module_keyname_1.HttpModuleKeyname}.logging-enabled`,
|
|
36
37
|
defaultValue: true,
|
|
37
38
|
isRequired: false,
|
|
38
39
|
defaultResolvers: [
|
|
39
40
|
new configuration_1.BooleanResolver(new configuration_1.EnvironmentVariableResolver("PRISTINE_HTTP_LOGGING")),
|
|
40
41
|
]
|
|
41
|
-
}
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
parameterName: `%${http_module_keyname_1.HttpModuleKeyname}.http-server.file.address%`,
|
|
45
|
+
defaultValue: "127.0.0.1",
|
|
46
|
+
isRequired: false,
|
|
47
|
+
defaultResolvers: [
|
|
48
|
+
new configuration_1.EnvironmentVariableResolver("PRISTINE_HTTP_SERVER_FILE_ADDRESS"),
|
|
49
|
+
]
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
parameterName: `%${http_module_keyname_1.HttpModuleKeyname}.http-server.file.port%`,
|
|
53
|
+
defaultValue: 9000,
|
|
54
|
+
isRequired: false,
|
|
55
|
+
defaultResolvers: [
|
|
56
|
+
new configuration_1.NumberResolver(new configuration_1.EnvironmentVariableResolver("PRISTINE_HTTP_SERVER_FILE_PORT")),
|
|
57
|
+
]
|
|
58
|
+
},
|
|
42
59
|
],
|
|
43
60
|
};
|
|
44
61
|
//# sourceMappingURL=http.module.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http.module.js","sourceRoot":"","sources":["../../../src/http.module.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AACA,+DAAwD;AACxD,kDAAmD;AACnD,
|
|
1
|
+
{"version":3,"file":"http.module.js","sourceRoot":"","sources":["../../../src/http.module.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AACA,+DAAwD;AACxD,kDAAmD;AACnD,8DAAwG;AAExG,wDAAsC;AACtC,oDAAkC;AAClC,gDAA8B;AAC9B,kDAAgC;AAChC,8DAA2C;AAC3C,0DAAuC;AACvC,oDAAkC;AAClC,oDAAkC;AAClC,gDAA8B;AAC9B,sDAAoC;AAEvB,QAAA,UAAU,GAAoB;IACvC,OAAO,EAAE,uCAAiB;IAC1B,aAAa,EAAE,CAAC,uBAAa,CAAC;IAC9B,wBAAwB,EAAE;QACtB;YACI,aAAa,EAAE,IAAI,uCAAiB,kBAAkB;YACtD,YAAY,EAAE,IAAI;YAClB,UAAU,EAAE,KAAK;YACjB,gBAAgB,EAAE;gBACd,IAAI,+BAAe,CAAC,IAAI,2CAA2B,CAAC,uBAAuB,CAAC,CAAC;aAChF;SACJ;QACD;YACI,aAAa,EAAE,IAAI,uCAAiB,4BAA4B;YAChE,YAAY,EAAE,WAAW;YACzB,UAAU,EAAE,KAAK;YACjB,gBAAgB,EAAE;gBACd,IAAI,2CAA2B,CAAC,mCAAmC,CAAC;aACvE;SACJ;QACD;YACI,aAAa,EAAE,IAAI,uCAAiB,yBAAyB;YAC7D,YAAY,EAAE,IAAI;YAClB,UAAU,EAAE,KAAK;YACjB,gBAAgB,EAAE;gBACd,IAAI,8BAAc,CAAC,IAAI,2CAA2B,CAAC,gCAAgC,CAAC,CAAC;aACxF;SACJ;KACJ;CACJ,CAAA"}
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
15
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
16
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
17
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
18
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
19
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
20
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
24
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
25
|
+
};
|
|
26
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
+
exports.FileHttpServer = void 0;
|
|
28
|
+
const tsyringe_1 = require("tsyringe");
|
|
29
|
+
const http_module_keyname_1 = require("../http.module.keyname");
|
|
30
|
+
const http_1 = __importDefault(require("http"));
|
|
31
|
+
const fs_1 = __importDefault(require("fs"));
|
|
32
|
+
const path_1 = __importDefault(require("path"));
|
|
33
|
+
const url_1 = __importDefault(require("url"));
|
|
34
|
+
let FileHttpServer = class FileHttpServer {
|
|
35
|
+
constructor(address, port) {
|
|
36
|
+
this.address = address;
|
|
37
|
+
this.port = port;
|
|
38
|
+
}
|
|
39
|
+
getPort() {
|
|
40
|
+
if (this.port) {
|
|
41
|
+
return this.port;
|
|
42
|
+
}
|
|
43
|
+
// Will bind to an open port if you specify 0.
|
|
44
|
+
return 0;
|
|
45
|
+
}
|
|
46
|
+
start(directory) {
|
|
47
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
48
|
+
const port = this.getPort();
|
|
49
|
+
const address = this.address;
|
|
50
|
+
return new Promise((resolve, reject) => {
|
|
51
|
+
http_1.default.createServer((req, res) => {
|
|
52
|
+
if (req.url === undefined) {
|
|
53
|
+
console.error("URL undefined, skipping.");
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
// parse URL
|
|
57
|
+
const parsedUrl = url_1.default.parse(req.url);
|
|
58
|
+
// extract URL path
|
|
59
|
+
let pathname = path_1.default.join(directory, `${parsedUrl.pathname}`);
|
|
60
|
+
// based on the URL path, extract the file extension. e.g. .js, .doc, ...
|
|
61
|
+
const ext = path_1.default.parse(pathname).ext;
|
|
62
|
+
// maps file extension to MIME typere
|
|
63
|
+
const map = {
|
|
64
|
+
".aac": "audio/aac",
|
|
65
|
+
".abw": "application/x-abiword",
|
|
66
|
+
".arc": "application/x-freearc",
|
|
67
|
+
".avi": "video/x-msvideo",
|
|
68
|
+
".azw": "application/vnd.amazon.ebook",
|
|
69
|
+
".bin": "application/octet-stream",
|
|
70
|
+
".bmp": "image/bmp",
|
|
71
|
+
".bz": "application/x-bzip",
|
|
72
|
+
".bz2": "application/x-bzip2",
|
|
73
|
+
".csh": "application/x-csh",
|
|
74
|
+
".css": "text/css",
|
|
75
|
+
".csv": "text/csv",
|
|
76
|
+
".doc": "application/msword",
|
|
77
|
+
".docx": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
|
78
|
+
".eot": "application/vnd.ms-fontobject",
|
|
79
|
+
".epub": "application/epub+zip",
|
|
80
|
+
".gif": "image/gif",
|
|
81
|
+
".htm": "text/html",
|
|
82
|
+
".html": "text/html",
|
|
83
|
+
".ico": "image/vnd.microsoft.icon",
|
|
84
|
+
".ics": "text/calendar",
|
|
85
|
+
".jar": "application/java-archive",
|
|
86
|
+
".jpeg": "image/jpeg",
|
|
87
|
+
".jpg": "image/jpeg",
|
|
88
|
+
".js": "text/javascript",
|
|
89
|
+
".json": "application/json",
|
|
90
|
+
".jsonld": "application/ld+json",
|
|
91
|
+
".mid": "audio/midi",
|
|
92
|
+
".midi": "audio/midi",
|
|
93
|
+
".mjs": "text/javascript",
|
|
94
|
+
".mp3": "audio/mpeg",
|
|
95
|
+
".mp4": "video/mp4",
|
|
96
|
+
".mpeg": "video/mpeg",
|
|
97
|
+
".mpkg": "application/vnd.apple.installer+xml",
|
|
98
|
+
".odp": "application/vnd.oasis.opendocument.presentation",
|
|
99
|
+
".ods": "application/vnd.oasis.opendocument.spreadsheet",
|
|
100
|
+
".odt": "application/vnd.oasis.opendocument.text",
|
|
101
|
+
".oga": "audio/ogg",
|
|
102
|
+
".ogv": "video/ogg",
|
|
103
|
+
".ogx": "application/ogg",
|
|
104
|
+
".otf": "font/otf",
|
|
105
|
+
".png": "image/png",
|
|
106
|
+
".pdf": "application/pdf",
|
|
107
|
+
".php": "application/php",
|
|
108
|
+
".ppt": "application/vnd.ms-powerpoint",
|
|
109
|
+
".pptx": "application/vnd.openxmlformats-officedocument.presentationml.presentation",
|
|
110
|
+
".rar": "application/vnd.rar",
|
|
111
|
+
".rtf": "application/rtf",
|
|
112
|
+
".sh": "application/x-sh",
|
|
113
|
+
".svg": "image/svg+xml",
|
|
114
|
+
".swf": "application/x-shockwave-flash",
|
|
115
|
+
".tar": "application/x-tar",
|
|
116
|
+
".tif": "image/tiff",
|
|
117
|
+
".tiff": "image/tiff",
|
|
118
|
+
".ts": "video/mp2t",
|
|
119
|
+
".ttf": "font/ttf",
|
|
120
|
+
".txt": "text/plain",
|
|
121
|
+
".vsd": "application/vnd.visio",
|
|
122
|
+
".wav": "audio/wav",
|
|
123
|
+
".weba": "audio/webm",
|
|
124
|
+
".webm": "video/webm",
|
|
125
|
+
".webp": "image/webp",
|
|
126
|
+
".woff": "font/woff",
|
|
127
|
+
".woff2": "font/woff2",
|
|
128
|
+
".xhtml": "application/xhtml+xml",
|
|
129
|
+
".xls": "application/vnd.ms-excel",
|
|
130
|
+
".xlsx": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
131
|
+
".xml": "application/xml",
|
|
132
|
+
".xul": "application/vnd.mozilla.xul+xml",
|
|
133
|
+
".zip": "application/zip",
|
|
134
|
+
".3gp": "video/3gpp",
|
|
135
|
+
".3g2": "video/3gpp2",
|
|
136
|
+
".7z": "application/x-7z-compressed"
|
|
137
|
+
};
|
|
138
|
+
fs_1.default.exists(pathname, function (exist) {
|
|
139
|
+
if (!exist) {
|
|
140
|
+
// if the file is not found, return 404
|
|
141
|
+
res.statusCode = 404;
|
|
142
|
+
res.end(`File ${pathname} not found!`);
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
// if is a directory search for index file matching the extension
|
|
146
|
+
if (fs_1.default.statSync(pathname).isDirectory())
|
|
147
|
+
pathname += '/index' + ext;
|
|
148
|
+
// read file from file system
|
|
149
|
+
fs_1.default.readFile(pathname, function (err, data) {
|
|
150
|
+
var _a;
|
|
151
|
+
if (err) {
|
|
152
|
+
res.statusCode = 500;
|
|
153
|
+
res.end(`Error getting the file: ${err}.`);
|
|
154
|
+
}
|
|
155
|
+
else {
|
|
156
|
+
// if the file is found, set Content-type and send data
|
|
157
|
+
res.setHeader('Content-type', (_a = map[ext]) !== null && _a !== void 0 ? _a : 'text/plain');
|
|
158
|
+
res.end(data);
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
});
|
|
162
|
+
}).listen(port, address, () => {
|
|
163
|
+
console.log("Server started on port: " + port);
|
|
164
|
+
return resolve();
|
|
165
|
+
});
|
|
166
|
+
});
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
};
|
|
170
|
+
exports.FileHttpServer = FileHttpServer;
|
|
171
|
+
exports.FileHttpServer = FileHttpServer = __decorate([
|
|
172
|
+
(0, tsyringe_1.injectable)(),
|
|
173
|
+
__param(0, (0, tsyringe_1.inject)(`%${http_module_keyname_1.HttpModuleKeyname}.http-server.file.address%`)),
|
|
174
|
+
__param(1, (0, tsyringe_1.inject)(`%${http_module_keyname_1.HttpModuleKeyname}.http-server.file.port%`)),
|
|
175
|
+
__metadata("design:paramtypes", [String, Number])
|
|
176
|
+
], FileHttpServer);
|
|
177
|
+
//# sourceMappingURL=file.http-server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file.http-server.js","sourceRoot":"","sources":["../../../../src/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AC;gCACrB,GAAG,CAAC,GAAG,CAAC,2BAA2B,GAAG,GAAG,CAAC,CAAC;4BAC/C,CAAC;iCAAM,CAAC;gCACJ,uDAAuD;gCACvD,GAAG,CAAC,SAAS,CAAC,cAAc,EAAE,MAAA,GAAG,CAAC,GAAG,CAAC,mCAAI,YAAY,CAAE,CAAC;gCACzD,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;4BAClB,CAAC;wBACL,CAAC,CAAC,CAAC;oBACP,CAAC,CAAC,CAAC;gBAEP,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE;oBAC1B,OAAO,CAAC,GAAG,CAAC,0BAA0B,GAAG,IAAI,CAAC,CAAC;oBAE/C,OAAO,OAAO,EAAE,CAAC;gBACrB,CAAC,CAAC,CAAC;YACP,CAAC,CAAC,CAAC;QACP,CAAC;KAAA;CACJ,CAAA;AA3IY,wCAAc;yBAAd,cAAc;IAD1B,IAAA,qBAAU,GAAE;IAEI,WAAA,IAAA,iBAAM,EAAC,IAAI,uCAAiB,4BAA4B,CAAC,CAAA;IACzD,WAAA,IAAA,iBAAM,EAAC,IAAI,uCAAiB,yBAAyB,CAAC,CAAA;;GAF1D,cAAc,CA2I1B"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./file.http-server"), exports);
|
|
18
|
+
//# sourceMappingURL=servers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"servers.js","sourceRoot":"","sources":["../../../../src/servers/servers.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAmC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HttpModuleKeyname } from "./http.module.keyname";
|
|
2
2
|
import { LoggingModule } from "@pristine-ts/logging";
|
|
3
|
-
import { BooleanResolver, EnvironmentVariableResolver } from "@pristine-ts/configuration";
|
|
3
|
+
import { BooleanResolver, EnvironmentVariableResolver, NumberResolver } from "@pristine-ts/configuration";
|
|
4
4
|
export * from "./http.module.keyname";
|
|
5
5
|
export * from "./clients/clients";
|
|
6
6
|
export * from "./enums/enums";
|
|
@@ -8,6 +8,7 @@ export * from "./errors/errors";
|
|
|
8
8
|
export * from "./interceptors/interceptors";
|
|
9
9
|
export * from "./interfaces/interfaces";
|
|
10
10
|
export * from "./options/options";
|
|
11
|
+
export * from "./servers/servers";
|
|
11
12
|
export * from "./utils/utils";
|
|
12
13
|
export * from "./wrappers/wrappers";
|
|
13
14
|
export const HttpModule = {
|
|
@@ -15,13 +16,29 @@ export const HttpModule = {
|
|
|
15
16
|
importModules: [LoggingModule],
|
|
16
17
|
configurationDefinitions: [
|
|
17
18
|
{
|
|
18
|
-
parameterName:
|
|
19
|
+
parameterName: `%${HttpModuleKeyname}.logging-enabled`,
|
|
19
20
|
defaultValue: true,
|
|
20
21
|
isRequired: false,
|
|
21
22
|
defaultResolvers: [
|
|
22
23
|
new BooleanResolver(new EnvironmentVariableResolver("PRISTINE_HTTP_LOGGING")),
|
|
23
24
|
]
|
|
24
|
-
}
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
parameterName: `%${HttpModuleKeyname}.http-server.file.address%`,
|
|
28
|
+
defaultValue: "127.0.0.1",
|
|
29
|
+
isRequired: false,
|
|
30
|
+
defaultResolvers: [
|
|
31
|
+
new EnvironmentVariableResolver("PRISTINE_HTTP_SERVER_FILE_ADDRESS"),
|
|
32
|
+
]
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
parameterName: `%${HttpModuleKeyname}.http-server.file.port%`,
|
|
36
|
+
defaultValue: 9000,
|
|
37
|
+
isRequired: false,
|
|
38
|
+
defaultResolvers: [
|
|
39
|
+
new NumberResolver(new EnvironmentVariableResolver("PRISTINE_HTTP_SERVER_FILE_PORT")),
|
|
40
|
+
]
|
|
41
|
+
},
|
|
25
42
|
],
|
|
26
43
|
};
|
|
27
44
|
//# sourceMappingURL=http.module.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http.module.js","sourceRoot":"","sources":["../../../src/http.module.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,iBAAiB,EAAC,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAC,aAAa,EAAC,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAC,eAAe,EAAE,2BAA2B,EAAC,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"http.module.js","sourceRoot":"","sources":["../../../src/http.module.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,iBAAiB,EAAC,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAC,aAAa,EAAC,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAC,eAAe,EAAE,2BAA2B,EAAE,cAAc,EAAC,MAAM,4BAA4B,CAAC;AAExG,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,yBAAyB,CAAA;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AAEpC,MAAM,CAAC,MAAM,UAAU,GAAoB;IACvC,OAAO,EAAE,iBAAiB;IAC1B,aAAa,EAAE,CAAC,aAAa,CAAC;IAC9B,wBAAwB,EAAE;QACtB;YACI,aAAa,EAAE,IAAI,iBAAiB,kBAAkB;YACtD,YAAY,EAAE,IAAI;YAClB,UAAU,EAAE,KAAK;YACjB,gBAAgB,EAAE;gBACd,IAAI,eAAe,CAAC,IAAI,2BAA2B,CAAC,uBAAuB,CAAC,CAAC;aAChF;SACJ;QACD;YACI,aAAa,EAAE,IAAI,iBAAiB,4BAA4B;YAChE,YAAY,EAAE,WAAW;YACzB,UAAU,EAAE,KAAK;YACjB,gBAAgB,EAAE;gBACd,IAAI,2BAA2B,CAAC,mCAAmC,CAAC;aACvE;SACJ;QACD;YACI,aAAa,EAAE,IAAI,iBAAiB,yBAAyB;YAC7D,YAAY,EAAE,IAAI;YAClB,UAAU,EAAE,KAAK;YACjB,gBAAgB,EAAE;gBACd,IAAI,cAAc,CAAC,IAAI,2BAA2B,CAAC,gCAAgC,CAAC,CAAC;aACxF;SACJ;KACJ;CACJ,CAAA"}
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
11
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
12
|
+
};
|
|
13
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
14
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
15
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
16
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
17
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
18
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
19
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
import { injectable, inject } from "tsyringe";
|
|
23
|
+
import { HttpModuleKeyname } from "../http.module.keyname";
|
|
24
|
+
import http from "http";
|
|
25
|
+
import fs from "fs";
|
|
26
|
+
import path from "path";
|
|
27
|
+
import url from "url";
|
|
28
|
+
let FileHttpServer = class FileHttpServer {
|
|
29
|
+
constructor(address, port) {
|
|
30
|
+
this.address = address;
|
|
31
|
+
this.port = port;
|
|
32
|
+
}
|
|
33
|
+
getPort() {
|
|
34
|
+
if (this.port) {
|
|
35
|
+
return this.port;
|
|
36
|
+
}
|
|
37
|
+
// Will bind to an open port if you specify 0.
|
|
38
|
+
return 0;
|
|
39
|
+
}
|
|
40
|
+
start(directory) {
|
|
41
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
42
|
+
const port = this.getPort();
|
|
43
|
+
const address = this.address;
|
|
44
|
+
return new Promise((resolve, reject) => {
|
|
45
|
+
http.createServer((req, res) => {
|
|
46
|
+
if (req.url === undefined) {
|
|
47
|
+
console.error("URL undefined, skipping.");
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
// parse URL
|
|
51
|
+
const parsedUrl = url.parse(req.url);
|
|
52
|
+
// extract URL path
|
|
53
|
+
let pathname = path.join(directory, `${parsedUrl.pathname}`);
|
|
54
|
+
// based on the URL path, extract the file extension. e.g. .js, .doc, ...
|
|
55
|
+
const ext = path.parse(pathname).ext;
|
|
56
|
+
// maps file extension to MIME typere
|
|
57
|
+
const map = {
|
|
58
|
+
".aac": "audio/aac",
|
|
59
|
+
".abw": "application/x-abiword",
|
|
60
|
+
".arc": "application/x-freearc",
|
|
61
|
+
".avi": "video/x-msvideo",
|
|
62
|
+
".azw": "application/vnd.amazon.ebook",
|
|
63
|
+
".bin": "application/octet-stream",
|
|
64
|
+
".bmp": "image/bmp",
|
|
65
|
+
".bz": "application/x-bzip",
|
|
66
|
+
".bz2": "application/x-bzip2",
|
|
67
|
+
".csh": "application/x-csh",
|
|
68
|
+
".css": "text/css",
|
|
69
|
+
".csv": "text/csv",
|
|
70
|
+
".doc": "application/msword",
|
|
71
|
+
".docx": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
|
72
|
+
".eot": "application/vnd.ms-fontobject",
|
|
73
|
+
".epub": "application/epub+zip",
|
|
74
|
+
".gif": "image/gif",
|
|
75
|
+
".htm": "text/html",
|
|
76
|
+
".html": "text/html",
|
|
77
|
+
".ico": "image/vnd.microsoft.icon",
|
|
78
|
+
".ics": "text/calendar",
|
|
79
|
+
".jar": "application/java-archive",
|
|
80
|
+
".jpeg": "image/jpeg",
|
|
81
|
+
".jpg": "image/jpeg",
|
|
82
|
+
".js": "text/javascript",
|
|
83
|
+
".json": "application/json",
|
|
84
|
+
".jsonld": "application/ld+json",
|
|
85
|
+
".mid": "audio/midi",
|
|
86
|
+
".midi": "audio/midi",
|
|
87
|
+
".mjs": "text/javascript",
|
|
88
|
+
".mp3": "audio/mpeg",
|
|
89
|
+
".mp4": "video/mp4",
|
|
90
|
+
".mpeg": "video/mpeg",
|
|
91
|
+
".mpkg": "application/vnd.apple.installer+xml",
|
|
92
|
+
".odp": "application/vnd.oasis.opendocument.presentation",
|
|
93
|
+
".ods": "application/vnd.oasis.opendocument.spreadsheet",
|
|
94
|
+
".odt": "application/vnd.oasis.opendocument.text",
|
|
95
|
+
".oga": "audio/ogg",
|
|
96
|
+
".ogv": "video/ogg",
|
|
97
|
+
".ogx": "application/ogg",
|
|
98
|
+
".otf": "font/otf",
|
|
99
|
+
".png": "image/png",
|
|
100
|
+
".pdf": "application/pdf",
|
|
101
|
+
".php": "application/php",
|
|
102
|
+
".ppt": "application/vnd.ms-powerpoint",
|
|
103
|
+
".pptx": "application/vnd.openxmlformats-officedocument.presentationml.presentation",
|
|
104
|
+
".rar": "application/vnd.rar",
|
|
105
|
+
".rtf": "application/rtf",
|
|
106
|
+
".sh": "application/x-sh",
|
|
107
|
+
".svg": "image/svg+xml",
|
|
108
|
+
".swf": "application/x-shockwave-flash",
|
|
109
|
+
".tar": "application/x-tar",
|
|
110
|
+
".tif": "image/tiff",
|
|
111
|
+
".tiff": "image/tiff",
|
|
112
|
+
".ts": "video/mp2t",
|
|
113
|
+
".ttf": "font/ttf",
|
|
114
|
+
".txt": "text/plain",
|
|
115
|
+
".vsd": "application/vnd.visio",
|
|
116
|
+
".wav": "audio/wav",
|
|
117
|
+
".weba": "audio/webm",
|
|
118
|
+
".webm": "video/webm",
|
|
119
|
+
".webp": "image/webp",
|
|
120
|
+
".woff": "font/woff",
|
|
121
|
+
".woff2": "font/woff2",
|
|
122
|
+
".xhtml": "application/xhtml+xml",
|
|
123
|
+
".xls": "application/vnd.ms-excel",
|
|
124
|
+
".xlsx": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
125
|
+
".xml": "application/xml",
|
|
126
|
+
".xul": "application/vnd.mozilla.xul+xml",
|
|
127
|
+
".zip": "application/zip",
|
|
128
|
+
".3gp": "video/3gpp",
|
|
129
|
+
".3g2": "video/3gpp2",
|
|
130
|
+
".7z": "application/x-7z-compressed"
|
|
131
|
+
};
|
|
132
|
+
fs.exists(pathname, function (exist) {
|
|
133
|
+
if (!exist) {
|
|
134
|
+
// if the file is not found, return 404
|
|
135
|
+
res.statusCode = 404;
|
|
136
|
+
res.end(`File ${pathname} not found!`);
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
// if is a directory search for index file matching the extension
|
|
140
|
+
if (fs.statSync(pathname).isDirectory())
|
|
141
|
+
pathname += '/index' + ext;
|
|
142
|
+
// read file from file system
|
|
143
|
+
fs.readFile(pathname, function (err, data) {
|
|
144
|
+
var _a;
|
|
145
|
+
if (err) {
|
|
146
|
+
res.statusCode = 500;
|
|
147
|
+
res.end(`Error getting the file: ${err}.`);
|
|
148
|
+
}
|
|
149
|
+
else {
|
|
150
|
+
// if the file is found, set Content-type and send data
|
|
151
|
+
res.setHeader('Content-type', (_a = map[ext]) !== null && _a !== void 0 ? _a : 'text/plain');
|
|
152
|
+
res.end(data);
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
});
|
|
156
|
+
}).listen(port, address, () => {
|
|
157
|
+
console.log("Server started on port: " + port);
|
|
158
|
+
return resolve();
|
|
159
|
+
});
|
|
160
|
+
});
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
};
|
|
164
|
+
FileHttpServer = __decorate([
|
|
165
|
+
injectable(),
|
|
166
|
+
__param(0, inject(`%${HttpModuleKeyname}.http-server.file.address%`)),
|
|
167
|
+
__param(1, inject(`%${HttpModuleKeyname}.http-server.file.port%`)),
|
|
168
|
+
__metadata("design:paramtypes", [String, Number])
|
|
169
|
+
], FileHttpServer);
|
|
170
|
+
export { FileHttpServer };
|
|
171
|
+
//# sourceMappingURL=file.http-server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file.http-server.js","sourceRoot":"","sources":["../../../../src/servers/file.http-server.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAC,UAAU,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AG,EAAE,IAAI;;4BACpC,IAAG,GAAG,EAAC,CAAC;gCACJ,GAAG,CAAC,UAAU,GAAG,GAAG,CAAC;gCACrB,GAAG,CAAC,GAAG,CAAC,2BAA2B,GAAG,GAAG,CAAC,CAAC;4BAC/C,CAAC;iCAAM,CAAC;gCACJ,uDAAuD;gCACvD,GAAG,CAAC,SAAS,CAAC,cAAc,EAAE,MAAA,GAAG,CAAC,GAAG,CAAC,mCAAI,YAAY,CAAE,CAAC;gCACzD,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;4BAClB,CAAC;wBACL,CAAC,CAAC,CAAC;oBACP,CAAC,CAAC,CAAC;gBAEP,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE;oBAC1B,OAAO,CAAC,GAAG,CAAC,0BAA0B,GAAG,IAAI,CAAC,CAAC;oBAE/C,OAAO,OAAO,EAAE,CAAC;gBACrB,CAAC,CAAC,CAAC;YACP,CAAC,CAAC,CAAC;QACP,CAAC;KAAA;CACJ,CAAA;AA3IY,cAAc;IAD1B,UAAU,EAAE;IAEI,WAAA,MAAM,CAAC,IAAI,iBAAiB,4BAA4B,CAAC,CAAA;IACzD,WAAA,MAAM,CAAC,IAAI,iBAAiB,yBAAyB,CAAC,CAAA;;GAF1D,cAAc,CA2I1B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"servers.js","sourceRoot":"","sources":["../../../../src/servers/servers.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC"}
|
|
@@ -6,6 +6,7 @@ export * from "./errors/errors";
|
|
|
6
6
|
export * from "./interceptors/interceptors";
|
|
7
7
|
export * from "./interfaces/interfaces";
|
|
8
8
|
export * from "./options/options";
|
|
9
|
+
export * from "./servers/servers";
|
|
9
10
|
export * from "./utils/utils";
|
|
10
11
|
export * from "./wrappers/wrappers";
|
|
11
12
|
export declare const HttpModule: ModuleInterface;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./file.http-server";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pristine-ts/http",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.303",
|
|
4
4
|
"description": "",
|
|
5
5
|
"module": "dist/lib/esm/http.module.js",
|
|
6
6
|
"main": "dist/lib/cjs/http.module.js",
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
"dist"
|
|
16
16
|
],
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@pristine-ts/common": "^0.0.
|
|
19
|
-
"@pristine-ts/logging": "^0.0.
|
|
18
|
+
"@pristine-ts/common": "^0.0.303",
|
|
19
|
+
"@pristine-ts/logging": "^0.0.303",
|
|
20
20
|
"lodash": "^4.17.21"
|
|
21
21
|
},
|
|
22
22
|
"author": "",
|
|
@@ -58,5 +58,5 @@
|
|
|
58
58
|
"src/*.{js,ts}"
|
|
59
59
|
]
|
|
60
60
|
},
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "285ac87ab5fbfd466dd9b920c24bdb83d55711a6"
|
|
62
62
|
}
|