Compare commits

...

12 Commits

Author SHA1 Message Date
dab87b274d 2.0.63 2023-07-02 01:53:11 +02:00
85171cb736 fix(core): update 2023-07-02 01:53:10 +02:00
0fd5e0a209 2.0.62 2023-07-02 01:46:53 +02:00
eadab07f17 fix(core): update 2023-07-02 01:46:53 +02:00
378592acc3 2.0.61 2023-07-02 01:38:50 +02:00
f885e49e34 fix(core): update 2023-07-02 01:38:49 +02:00
078730153d 2.0.60 2023-07-02 01:23:41 +02:00
4467ab76aa fix(core): update 2023-07-02 01:23:41 +02:00
a0bbf31f75 2.0.59 2023-07-01 18:25:27 +02:00
13e9ac7a98 fix(core): update 2023-07-01 18:25:27 +02:00
0ec00a5404 2.0.58 2023-07-01 17:23:50 +02:00
b0f48ba598 fix(core): update 2023-07-01 17:23:49 +02:00
7 changed files with 63 additions and 49 deletions

View File

@ -1,6 +1,6 @@
{
"name": "@apiglobal/typedserver",
"version": "2.0.57",
"version": "2.0.63",
"description": "easy serving of static files",
"main": "dist_ts/index.js",
"typings": "dist_ts/index.d.ts",
@ -46,7 +46,7 @@
"@pushrocks/smartenv": "^5.0.5",
"@pushrocks/smartfeed": "^1.0.11",
"@pushrocks/smartfile": "^10.0.25",
"@pushrocks/smartlog": "^3.0.1",
"@pushrocks/smartlog": "^3.0.2",
"@pushrocks/smartlog-destination-devtools": "^1.0.10",
"@pushrocks/smartmanifest": "^2.0.2",
"@pushrocks/smartmime": "^1.0.5",
@ -59,6 +59,7 @@
"@pushrocks/smarttime": "^4.0.1",
"@pushrocks/webstore": "^2.0.8",
"@tsclass/tsclass": "^4.0.42",
"@types/express": "^4.17.17",
"body-parser": "^1.20.2",
"cors": "^2.8.5",
"express": "^4.18.2",
@ -69,7 +70,7 @@
"@gitzone/tsbuild": "^2.1.66",
"@gitzone/tsbundle": "^2.0.8",
"@gitzone/tsrun": "^1.2.42",
"@gitzone/tstest": "^1.0.72",
"@gitzone/tstest": "^1.0.74",
"@pushrocks/tapbundle": "^5.0.8",
"@types/node": "^20.3.3"
},

53
pnpm-lock.yaml generated
View File

@ -33,8 +33,8 @@ dependencies:
specifier: ^10.0.25
version: 10.0.25
'@pushrocks/smartlog':
specifier: ^3.0.1
version: 3.0.1
specifier: ^3.0.2
version: 3.0.2
'@pushrocks/smartlog-destination-devtools':
specifier: ^1.0.10
version: 1.0.10
@ -71,6 +71,9 @@ dependencies:
'@tsclass/tsclass':
specifier: ^4.0.42
version: 4.0.42
'@types/express':
specifier: ^4.17.17
version: 4.17.17
body-parser:
specifier: ^1.20.2
version: 1.20.2
@ -98,8 +101,8 @@ devDependencies:
specifier: ^1.2.42
version: 1.2.42(@types/node@20.3.3)
'@gitzone/tstest':
specifier: ^1.0.72
version: 1.0.72(@types/node@20.3.3)
specifier: ^1.0.74
version: 1.0.74(@types/node@20.3.3)
'@pushrocks/tapbundle':
specifier: ^5.0.8
version: 5.0.8
@ -435,8 +438,8 @@ packages:
- supports-color
dev: true
/@gitzone/tstest@1.0.72(@types/node@20.3.3):
resolution: {integrity: sha512-p8oBgHu5qg6hR9kn3nS2e6uBOgQMqIspJXAqEkD+U2Ios/uQwhC9+vkB9TlcVLeqdfZrZiglBSmeyl3f32wtpw==}
/@gitzone/tstest@1.0.74(@types/node@20.3.3):
resolution: {integrity: sha512-6V8bsfvpnODWqrkdooVqcOS1z5GA8dMDnLCOHnr/SUTeie3ox8KGpckwiZ+gTfz9WvzX6+KLVTZNYKGOaNbmMQ==}
hasBin: true
dependencies:
'@gitzone/tsbundle': 2.0.8
@ -446,12 +449,11 @@ packages:
'@pushrocks/smartdelay': 2.0.13
'@pushrocks/smartexpress': 4.0.35
'@pushrocks/smartfile': 10.0.25
'@pushrocks/smartlog': 3.0.1
'@pushrocks/smartlog': 3.0.2
'@pushrocks/smartpromise': 3.1.10
'@pushrocks/smartshell': 2.0.30
'@pushrocks/tapbundle': 5.0.8
'@types/figures': 3.0.1
figures: 4.0.1
figures: 5.0.0
transitivePeerDependencies:
- '@swc/core'
- '@swc/wasm'
@ -693,7 +695,7 @@ packages:
resolution: {integrity: sha512-nv2Ldy+jTRsVpGpOz+9o0F8FMELoWYk/sy5ecyh9AsP97Kdj3CtqwRwHhcl7mLepdrcRw1qHK3DAloln1XP4Vg==}
dependencies:
'@pushrocks/lik': 6.0.2
'@pushrocks/smartlog': 3.0.1
'@pushrocks/smartlog': 3.0.2
'@pushrocks/smartparam': 1.1.6
'@pushrocks/smartpromise': 3.1.10
'@pushrocks/smartrx': 2.0.27
@ -836,25 +838,18 @@ packages:
resolution: {integrity: sha512-tXqwfrekGxGZJB72BFQppywk7413hXVDgcJNeU+kY6xvmzVjf2HxOMbFYhewh1+p4uai1u9n0xcMb0qbbPy4/Q==}
dependencies:
'@apiglobal/typedrequest-interfaces': 1.0.20
dev: false
/@pushrocks/smartlog-interfaces@3.0.0:
resolution: {integrity: sha512-yjppiLLJHBcrXTJJusDbFTvHq0RTMl3LnhvWAhyyy8U0O4VkJxIls1t5mS6jsEwxogP88+0flQIWknNJeB913A==}
dependencies:
'@apiglobal/typedrequest-interfaces': 2.0.1
dev: true
/@pushrocks/smartlog@3.0.1:
resolution: {integrity: sha512-lE6BCrtZcDDjeXymHq9EK+VlrV3lhXXagFubgHiwrtX8+2xzihS3PpLE54pMARf5X5LE00xg1W0QxSzYJ9oMqg==}
dependencies:
'@pushrocks/isounique': 1.0.5
'@pushrocks/smartlog-interfaces': 2.0.23
/@pushrocks/smartlog@3.0.2:
resolution: {integrity: sha512-1WPA0LX9HfE54ESKtk32uvsXiYIMu2QX7NUlQ3uHSMmFULnJYo2m/LeKEf6qHH7DJtxZbkWzkrMOkZVPL1MeNg==}
dependencies:
'@pushrocks/isounique': 1.0.5
'@pushrocks/smartlog-interfaces': 3.0.0
dev: true
/@pushrocks/smartmanifest@1.0.8:
resolution: {integrity: sha512-inHmTp58Z8xl+c6mdOrfxc9IjUKuqho1i+WUI74G7rn6HwEn3cMd/06R1v80Xlx+95EYWzBwnYtuo7j7DafrdQ==}
@ -1013,7 +1008,7 @@ packages:
'@pushrocks/smartenv': 5.0.5
'@pushrocks/smartexpress': 4.0.35
'@pushrocks/smartjson': 5.0.6
'@pushrocks/smartlog': 3.0.1
'@pushrocks/smartlog': 3.0.2
'@pushrocks/smartpromise': 3.1.10
'@pushrocks/smartrx': 3.0.2
'@pushrocks/smarttime': 4.0.1
@ -1310,13 +1305,6 @@ packages:
'@types/qs': 6.9.7
'@types/serve-static': 1.15.2
/@types/figures@3.0.1:
resolution: {integrity: sha512-2OXodKWdNhYl+S+wCvlafqJbfMIVDfQZYX2wRyUOcRiEQpeJ9zU6cT7d+RbMpjS+/vmQ2cAUUL8gyGy1YxtLPw==}
deprecated: This is a stub types definition. figures provides its own type definitions, so you do not need this installed.
dependencies:
figures: 4.0.1
dev: true
/@types/finalhandler@1.2.0:
resolution: {integrity: sha512-NgEZKOhxUSXkwNnWNaMXZaopQ5aFGPAYiEpEWIkQ6Dzc4iS0M1oQsvWne2t+ex9QZUAdTz/ZT4tOXJhWtP6mCw==}
dependencies:
@ -1609,6 +1597,11 @@ packages:
- utf-8-validate
dev: true
/@xmldom/xmldom@0.8.8:
resolution: {integrity: sha512-0LNz4EY8B/8xXY86wMrQ4tz6zEHZv9ehFMJPm8u2gq5lQ71cfRKdaKyxfJAx5aUoyzx0qzgURblTisPGgz3d+Q==}
engines: {node: '>=10.0.0'}
dev: true
/accepts@1.3.8:
resolution: {integrity: sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==}
engines: {node: '>= 0.6'}
@ -2445,9 +2438,9 @@ packages:
dependencies:
xml-js: 1.6.11
/figures@4.0.1:
resolution: {integrity: sha512-rElJwkA/xS04Vfg+CaZodpso7VqBknOYbzi6I76hI4X80RUjkSxO2oAyPmGbuXUppywjqndOrQDl817hDnI++w==}
engines: {node: '>=12'}
/figures@5.0.0:
resolution: {integrity: sha512-ej8ksPF4x6e5wvK9yevct0UCXh8TTFlWGVLlgjZuoBH1HwjIfKE/IdL5mq89sFA7zELi1VhKpmtDnrs7zWyeyg==}
engines: {node: '>=14'}
dependencies:
escape-string-regexp: 5.0.0
is-unicode-supported: 1.3.0
@ -3486,6 +3479,8 @@ packages:
resolution: {integrity: sha512-mXF9AIgnvq1DP/ZM2R28tAfxP2wKZHYa2DjV0R1KCwcqSzm5Iqh1XQq9rdfAt6dp2DuPP0VHZIaCALc2v1cL5A==}
engines: {node: '>=14.18.0', npm: '>=6.14.15'}
hasBin: true
dependencies:
'@xmldom/xmldom': 0.8.8
dev: true
bundledDependencies:
- '@xmldom/xmldom'

View File

@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@apiglobal/typedserver',
version: '2.0.57',
version: '2.0.63',
description: 'easy serving of static files'
}

View File

@ -1,5 +1,5 @@
import * as plugins from '../typedserver.plugins.js';
import { Request, Response } from 'express';
import { type Request, type Response } from 'express';
export interface IHandlerFunction {
(requestArg: Request, responseArg: Response): void;

View File

@ -3,7 +3,7 @@ import { Handler } from './classes.handler.js';
import { Server } from './classes.server.js';
import { ObjectMap } from '@pushrocks/lik';
import { IRoute as IExpressRoute } from 'express';
import { type IRoute as IExpressRoute } from 'express';
export class Route {
public routeString: string;

View File

@ -105,7 +105,6 @@ export class Server {
// general request handlling
this.expressAppInstance.use((req, res, next) => {
req.setTimeout(60 * 1000);
next();
});
@ -219,25 +218,44 @@ export class Server {
this.httpServer.on('connection', (connection: plugins.net.Socket) => {
this.socketMap.add(connection);
console.log(`added connection. now ${this.socketMap.getArray().length} sockets connected.`);
const closeListener = () => {
console.log('connection closed');
cleanupConnection();
};
const errorListener = () => {
console.log('connection errored');
cleanupConnection();
};
const endListener = () => {
console.log('connection ended');
cleanupConnection();
};
const timeoutListener = () => {
console.log('connection timed out');
cleanupConnection();
};
connection.addListener('close', closeListener);
connection.addListener('error', errorListener);
connection.addListener('end', endListener);
connection.addListener('timeout', timeoutListener);
const cleanupConnection = () => {
connection.removeListener('close', closeListener);
connection.removeListener('error', errorListener);
connection.removeListener('end', endListener);
connection.removeListener('timeout', timeoutListener);
if (this.socketMap.checkForObject(connection)) {
this.socketMap.remove(connection);
console.log(`removed connection. ${this.socketMap.getArray().length} sockets remaining.`);
connection.destroy();
}
};
connection.on('close', () => {
cleanupConnection();
});
connection.on('error', () => {
cleanupConnection();
});
connection.on('end', () => {
cleanupConnection();
});
connection.on('timeout', () => {
cleanupConnection();
});
});
// finally listen on a port

View File

@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@apiglobal/typedserver',
version: '2.0.57',
version: '2.0.63',
description: 'easy serving of static files'
}