serverpreconfigured 2.1.2 → 2.1.3
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/expressServer.d.ts +8 -2
- package/dist/expressServer.js +4 -1
- package/package.json +1 -1
- package/src/expressServer.ts +8 -2
package/dist/expressServer.d.ts
CHANGED
|
@@ -1,12 +1,18 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import express from "express";
|
|
3
|
+
import { Express } from "express";
|
|
4
|
+
import { Server } from "http";
|
|
1
5
|
export default class ExpressServer {
|
|
2
|
-
app:
|
|
6
|
+
app: Express;
|
|
3
7
|
authBaseUrl: string;
|
|
4
8
|
usePort: number;
|
|
9
|
+
server?: Server;
|
|
5
10
|
wsAuthBaseUrl: string;
|
|
6
11
|
constructor();
|
|
7
12
|
listen(port?: any): void;
|
|
8
13
|
initModules(): void;
|
|
9
14
|
initAuthSystem(baseUrl?: string): void;
|
|
10
15
|
initWSAuthSystem(wsBaseUrl?: string): void;
|
|
11
|
-
getApp():
|
|
16
|
+
getApp(): express.Express;
|
|
17
|
+
getServer(): Server | undefined;
|
|
12
18
|
}
|
package/dist/expressServer.js
CHANGED
|
@@ -21,7 +21,7 @@ class ExpressServer {
|
|
|
21
21
|
listen(port = null) {
|
|
22
22
|
if (port != null)
|
|
23
23
|
this.usePort = parseInt(port);
|
|
24
|
-
this.app.listen(this.usePort);
|
|
24
|
+
this.server = this.app.listen(this.usePort);
|
|
25
25
|
}
|
|
26
26
|
initModules() {
|
|
27
27
|
(0, sessions_1.initSessions)(this.app);
|
|
@@ -39,5 +39,8 @@ class ExpressServer {
|
|
|
39
39
|
getApp() {
|
|
40
40
|
return this.app;
|
|
41
41
|
}
|
|
42
|
+
getServer() {
|
|
43
|
+
return this.server;
|
|
44
|
+
}
|
|
42
45
|
}
|
|
43
46
|
exports.default = ExpressServer;
|
package/package.json
CHANGED
package/src/expressServer.ts
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import express from "express";
|
|
2
|
+
import { Express } from "express";
|
|
2
3
|
import { initSessions } from "./modules/sessions";
|
|
3
4
|
import { initPostReader } from "./modules/postreader";
|
|
4
5
|
import { initCors } from "./modules/initcors";
|
|
5
6
|
import ENV from "./settings/env";
|
|
6
7
|
import authRouter from "./routes/users";
|
|
7
8
|
import { router as wsAuthRoter } from "./routes/wsauth";
|
|
9
|
+
import { Server } from "http";
|
|
8
10
|
export default class ExpressServer{
|
|
9
|
-
app:
|
|
11
|
+
app:Express;
|
|
10
12
|
authBaseUrl:string;
|
|
11
13
|
usePort:number;
|
|
14
|
+
server?:Server;
|
|
12
15
|
wsAuthBaseUrl:string;
|
|
13
16
|
constructor(){
|
|
14
17
|
this.authBaseUrl="";
|
|
@@ -20,7 +23,7 @@ export default class ExpressServer{
|
|
|
20
23
|
listen(port:any=null){
|
|
21
24
|
if(port!=null)
|
|
22
25
|
this.usePort=parseInt(port);
|
|
23
|
-
this.app.listen(this.usePort);
|
|
26
|
+
this.server=this.app.listen(this.usePort);
|
|
24
27
|
}
|
|
25
28
|
|
|
26
29
|
initModules(){
|
|
@@ -40,4 +43,7 @@ export default class ExpressServer{
|
|
|
40
43
|
getApp(){
|
|
41
44
|
return this.app;
|
|
42
45
|
}
|
|
46
|
+
getServer(){
|
|
47
|
+
return this.server;
|
|
48
|
+
}
|
|
43
49
|
}
|