Compare commits
20 Commits
Author | SHA1 | Date | |
---|---|---|---|
9774567dc0 | |||
529c5feeb1 | |||
d2cac36a6e | |||
2cdef55f13 | |||
05444b757b | |||
1ef5c0da06 | |||
00b4108803 | |||
7e75cccbcb | |||
f93d10d394 | |||
d949a05c79 | |||
d281569bbb | |||
ef06dd138e | |||
60b610fc4a | |||
b4e9bd5174 | |||
1754524184 | |||
618f382ce9 | |||
ef9883f100 | |||
99db788d11 | |||
f7966e1f58 | |||
9828f7bc13 |
@ -105,6 +105,6 @@ jobs:
|
||||
run: |
|
||||
npmci node install stable
|
||||
npmci npm install
|
||||
pnpm install -g @gitzone/tsdoc
|
||||
pnpm install -g @git.zone/tsdoc
|
||||
npmci command tsdoc
|
||||
continue-on-error: true
|
||||
|
@ -9,7 +9,7 @@
|
||||
"gitscope": "pushrocks",
|
||||
"gitrepo": "typedserver",
|
||||
"description": "easy serving of static files",
|
||||
"npmPackagename": "@apiglobal/typedserver",
|
||||
"npmPackagename": "@api.global/typedserver",
|
||||
"license": "MIT"
|
||||
}
|
||||
}
|
||||
|
64
package.json
64
package.json
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@apiglobal/typedserver",
|
||||
"version": "2.0.63",
|
||||
"name": "@api.global/typedserver",
|
||||
"version": "3.0.7",
|
||||
"description": "easy serving of static files",
|
||||
"main": "dist_ts/index.js",
|
||||
"typings": "dist_ts/index.d.ts",
|
||||
@ -37,42 +37,42 @@
|
||||
],
|
||||
"homepage": "https://github.com/pushrocks/easyserve",
|
||||
"dependencies": {
|
||||
"@apiglobal/typedrequest": "^2.0.12",
|
||||
"@apiglobal/typedrequest-interfaces": "^2.0.1",
|
||||
"@apiglobal/typedsocket": "^2.0.24",
|
||||
"@pushrocks/lik": "^6.0.2",
|
||||
"@pushrocks/smartchok": "^1.0.23",
|
||||
"@pushrocks/smartdelay": "^3.0.1",
|
||||
"@pushrocks/smartenv": "^5.0.5",
|
||||
"@pushrocks/smartfeed": "^1.0.11",
|
||||
"@pushrocks/smartfile": "^10.0.25",
|
||||
"@pushrocks/smartlog": "^3.0.2",
|
||||
"@pushrocks/smartlog-destination-devtools": "^1.0.10",
|
||||
"@pushrocks/smartmanifest": "^2.0.2",
|
||||
"@pushrocks/smartmime": "^1.0.5",
|
||||
"@pushrocks/smartopen": "^2.0.0",
|
||||
"@pushrocks/smartpath": "^5.0.5",
|
||||
"@pushrocks/smartpromise": "^4.0.2",
|
||||
"@pushrocks/smartrequest": "^2.0.15",
|
||||
"@pushrocks/smartrx": "^3.0.2",
|
||||
"@pushrocks/smartsitemap": "^2.0.1",
|
||||
"@pushrocks/smarttime": "^4.0.1",
|
||||
"@pushrocks/webstore": "^2.0.8",
|
||||
"@tsclass/tsclass": "^4.0.42",
|
||||
"@types/express": "^4.17.17",
|
||||
"@api.global/typedrequest": "^3.0.2",
|
||||
"@api.global/typedrequest-interfaces": "^3.0.1",
|
||||
"@api.global/typedsocket": "^3.0.0",
|
||||
"@push.rocks/lik": "^6.0.5",
|
||||
"@push.rocks/smartchok": "^1.0.23",
|
||||
"@push.rocks/smartdelay": "^3.0.5",
|
||||
"@push.rocks/smartenv": "^5.0.10",
|
||||
"@push.rocks/smartfeed": "^1.0.11",
|
||||
"@push.rocks/smartfile": "^10.0.33",
|
||||
"@push.rocks/smartlog": "^3.0.3",
|
||||
"@push.rocks/smartlog-destination-devtools": "^1.0.10",
|
||||
"@push.rocks/smartmanifest": "^2.0.2",
|
||||
"@push.rocks/smartmime": "^1.0.5",
|
||||
"@push.rocks/smartopen": "^2.0.0",
|
||||
"@push.rocks/smartpath": "^5.0.11",
|
||||
"@push.rocks/smartpromise": "^4.0.2",
|
||||
"@push.rocks/smartrequest": "^2.0.18",
|
||||
"@push.rocks/smartrx": "^3.0.6",
|
||||
"@push.rocks/smartsitemap": "^2.0.3",
|
||||
"@push.rocks/smarttime": "^4.0.6",
|
||||
"@push.rocks/webstore": "^2.0.13",
|
||||
"@tsclass/tsclass": "^4.0.46",
|
||||
"@types/express": "^4.17.20",
|
||||
"body-parser": "^1.20.2",
|
||||
"cors": "^2.8.5",
|
||||
"express": "^4.18.2",
|
||||
"express-force-ssl": "^0.3.2",
|
||||
"lit": "^2.7.5"
|
||||
"lit": "^3.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@gitzone/tsbuild": "^2.1.66",
|
||||
"@gitzone/tsbundle": "^2.0.8",
|
||||
"@gitzone/tsrun": "^1.2.42",
|
||||
"@gitzone/tstest": "^1.0.74",
|
||||
"@pushrocks/tapbundle": "^5.0.8",
|
||||
"@types/node": "^20.3.3"
|
||||
"@git.zone/tsbuild": "^2.1.66",
|
||||
"@git.zone/tsbundle": "^2.0.8",
|
||||
"@git.zone/tsrun": "^1.2.44",
|
||||
"@git.zone/tstest": "^1.0.77",
|
||||
"@push.rocks/tapbundle": "^5.0.15",
|
||||
"@types/node": "^20.8.7"
|
||||
},
|
||||
"private": false,
|
||||
"browserslist": [
|
||||
|
3101
pnpm-lock.yaml
generated
3101
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@ -1,5 +1,5 @@
|
||||
import { tap, expect } from '@pushrocks/tapbundle';
|
||||
import * as smartpath from '@pushrocks/smartpath';
|
||||
import { tap, expect } from '@push.rocks/tapbundle';
|
||||
import * as smartpath from '@push.rocks/smartpath';
|
||||
|
||||
import { TypedServer } from '../ts/index.js';
|
||||
|
||||
|
@ -1,11 +1,11 @@
|
||||
// tslint:disable-next-line:no-implicit-dependencies
|
||||
import { expect, tap } from '@pushrocks/tapbundle';
|
||||
import { expect, tap } from '@push.rocks/tapbundle';
|
||||
|
||||
// helper dependencies
|
||||
// tslint:disable-next-line:no-implicit-dependencies
|
||||
|
||||
import * as smartpath from '@pushrocks/smartpath';
|
||||
import * as smartrequest from '@pushrocks/smartrequest';
|
||||
import * as smartpath from '@push.rocks/smartpath';
|
||||
import * as smartrequest from '@push.rocks/smartrequest';
|
||||
|
||||
import * as typedserver from '../ts/index.js';
|
||||
|
||||
@ -27,6 +27,13 @@ tap.test('should create a valid Server', async () => {
|
||||
manifest: {
|
||||
name: 'Test App',
|
||||
short_name: 'testapp',
|
||||
start_url: '/',
|
||||
display: 'standalone',
|
||||
background_color: '#000',
|
||||
theme_color: '#000',
|
||||
scope: '/',
|
||||
lang: 'en',
|
||||
display_override: ['window-controls-overlay'],
|
||||
},
|
||||
feed: true,
|
||||
sitemap: true,
|
||||
@ -71,7 +78,7 @@ tap.test('should create a valid StaticHandler', async () => {
|
||||
});
|
||||
|
||||
tap.test('should add typedrequest and typedsocket', async () => {
|
||||
const typedrequest = await import('@apiglobal/typedrequest');
|
||||
const typedrequest = await import('@api.global/typedrequest');
|
||||
|
||||
const typedrouter = new typedrequest.TypedRouter();
|
||||
testServer.addTypedRequest(typedrouter);
|
||||
|
@ -2,7 +2,7 @@
|
||||
* autocreated commitinfo by @pushrocks/commitinfo
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@apiglobal/typedserver',
|
||||
version: '2.0.63',
|
||||
name: '@api.global/typedserver',
|
||||
version: '3.0.7',
|
||||
description: 'easy serving of static files'
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
import * as typedrequestInterfaces from '@apiglobal/typedrequest-interfaces';
|
||||
// not using the global plugins here to support better bundling...
|
||||
import * as typedrequestInterfaces from '@api.global/typedrequest-interfaces';
|
||||
|
||||
export interface IReq_PushLatestServerChangeTime
|
||||
extends typedrequestInterfaces.implementsTR<
|
||||
|
@ -2,13 +2,12 @@ import * as plugins from '../typedserver.plugins.js';
|
||||
import { Handler } from './classes.handler.js';
|
||||
import { Server } from './classes.server.js';
|
||||
|
||||
import { ObjectMap } from '@pushrocks/lik';
|
||||
import { type IRoute as IExpressRoute } from 'express';
|
||||
|
||||
export class Route {
|
||||
public routeString: string;
|
||||
public handlerObjectMap = new ObjectMap<Handler>();
|
||||
public expressMiddlewareObjectMap = new ObjectMap<any>();
|
||||
public handlerObjectMap = new plugins.lik.ObjectMap<Handler>();
|
||||
public expressMiddlewareObjectMap = new plugins.lik.ObjectMap<any>();
|
||||
public expressRoute: IExpressRoute; // will be set to server route on server start
|
||||
constructor(ServerArg: Server, routeStringArg: string) {
|
||||
this.routeString = routeStringArg;
|
||||
|
@ -132,7 +132,8 @@ export class Server {
|
||||
|
||||
this.expressAppInstance.use((req, res, next) => {
|
||||
res.setHeader('Cross-Origin-Resource-Policy', 'cross-origin');
|
||||
res.setHeader('Cross-Origin-Embedder-Policy', 'unsafe-none');
|
||||
res.setHeader('Cross-Origin-Embedder-Policy', 'require-corp');
|
||||
res.setHeader('Cross-Origin-Opener-Policy', 'same-origin');
|
||||
res.setHeader('Access-Control-Allow-Origin', '*');
|
||||
res.setHeader('SERVEZONE_ROUTE', 'LOSSLESS_ORIGIN_CONTAINER');
|
||||
res.setHeader('Cache-Control', 'no-cache');
|
||||
@ -244,7 +245,7 @@ export class Server {
|
||||
connection.addListener('end', endListener);
|
||||
connection.addListener('timeout', timeoutListener);
|
||||
|
||||
const cleanupConnection = () => {
|
||||
const cleanupConnection = async () => {
|
||||
connection.removeListener('close', closeListener);
|
||||
connection.removeListener('error', errorListener);
|
||||
connection.removeListener('end', endListener);
|
||||
@ -253,7 +254,10 @@ export class Server {
|
||||
if (this.socketMap.checkForObject(connection)) {
|
||||
this.socketMap.remove(connection);
|
||||
console.log(`removed connection. ${this.socketMap.getArray().length} sockets remaining.`);
|
||||
connection.destroy();
|
||||
await plugins.smartdelay.delayFor(0);
|
||||
if (connection.destroyed === false) {
|
||||
connection.destroy();
|
||||
}
|
||||
}
|
||||
};
|
||||
});
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { Server } from './classes.server.js';
|
||||
import { Handler } from './classes.handler.js';
|
||||
import * as plugins from '../typedserver.plugins.js';
|
||||
import { type IUrlInfo } from '@pushrocks/smartsitemap';
|
||||
import { type IUrlInfo } from '@push.rocks/smartsitemap';
|
||||
|
||||
export class Sitemap {
|
||||
public smartexpressRef: Server;
|
||||
|
@ -109,6 +109,10 @@ export class TypedServer {
|
||||
}
|
||||
})
|
||||
);
|
||||
this.server.addRoute(
|
||||
'/typedrequest',
|
||||
new servertools.HandlerTypedRouter(this.typedrouter)
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -12,27 +12,27 @@ import * as tsclass from '@tsclass/tsclass';
|
||||
export { tsclass };
|
||||
|
||||
// @apiglobal scope
|
||||
import * as typedrequest from '@apiglobal/typedrequest';
|
||||
import * as typedrequestInterfaces from '@apiglobal/typedrequest-interfaces';
|
||||
import * as typedsocket from '@apiglobal/typedsocket';
|
||||
import * as typedrequest from '@api.global/typedrequest';
|
||||
import * as typedrequestInterfaces from '@api.global/typedrequest-interfaces';
|
||||
import * as typedsocket from '@api.global/typedsocket';
|
||||
|
||||
export { typedrequest, typedrequestInterfaces, typedsocket };
|
||||
|
||||
// @pushrocks scope
|
||||
import * as lik from '@pushrocks/lik';
|
||||
import * as smartchok from '@pushrocks/smartchok';
|
||||
import * as smartdelay from '@pushrocks/smartdelay';
|
||||
import * as smartfeed from '@pushrocks/smartfeed';
|
||||
import * as smartfile from '@pushrocks/smartfile';
|
||||
import * as smartmanifest from '@pushrocks/smartmanifest';
|
||||
import * as smartmime from '@pushrocks/smartmime';
|
||||
import * as smartopen from '@pushrocks/smartopen';
|
||||
import * as smartpath from '@pushrocks/smartpath';
|
||||
import * as smartpromise from '@pushrocks/smartpromise';
|
||||
import * as smartrequest from '@pushrocks/smartrequest';
|
||||
import * as smartrx from '@pushrocks/smartrx';
|
||||
import * as smartsitemap from '@pushrocks/smartsitemap';
|
||||
import * as smarttime from '@pushrocks/smarttime';
|
||||
import * as lik from '@push.rocks/lik';
|
||||
import * as smartchok from '@push.rocks/smartchok';
|
||||
import * as smartdelay from '@push.rocks/smartdelay';
|
||||
import * as smartfeed from '@push.rocks/smartfeed';
|
||||
import * as smartfile from '@push.rocks/smartfile';
|
||||
import * as smartmanifest from '@push.rocks/smartmanifest';
|
||||
import * as smartmime from '@push.rocks/smartmime';
|
||||
import * as smartopen from '@push.rocks/smartopen';
|
||||
import * as smartpath from '@push.rocks/smartpath';
|
||||
import * as smartpromise from '@push.rocks/smartpromise';
|
||||
import * as smartrequest from '@push.rocks/smartrequest';
|
||||
import * as smartrx from '@push.rocks/smartrx';
|
||||
import * as smartsitemap from '@push.rocks/smartsitemap';
|
||||
import * as smarttime from '@push.rocks/smarttime';
|
||||
|
||||
export {
|
||||
lik,
|
||||
|
@ -2,7 +2,7 @@
|
||||
* autocreated commitinfo by @pushrocks/commitinfo
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@apiglobal/typedserver',
|
||||
version: '2.0.63',
|
||||
name: '@api.global/typedserver',
|
||||
version: '3.0.7',
|
||||
description: 'easy serving of static files'
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
// @apiglobal scope
|
||||
import * as typedrequest from '@apiglobal/typedrequest';
|
||||
import * as typedsocket from '@apiglobal/typedsocket';
|
||||
import * as typedrequest from '@api.global/typedrequest';
|
||||
import * as typedsocket from '@api.global/typedsocket';
|
||||
|
||||
export {
|
||||
typedrequest,
|
||||
@ -8,10 +8,10 @@ export {
|
||||
}
|
||||
|
||||
// pushrocks scope
|
||||
import * as smartdelay from '@pushrocks/smartdelay';
|
||||
import * as smartlog from '@pushrocks/smartlog';
|
||||
import * as smartlogDestinationDevtools from '@pushrocks/smartlog-destination-devtools';
|
||||
import * as webstore from '@pushrocks/webstore';
|
||||
import * as smartdelay from '@push.rocks/smartdelay';
|
||||
import * as smartlog from '@push.rocks/smartlog';
|
||||
import * as smartlogDestinationDevtools from '@push.rocks/smartlog-destination-devtools';
|
||||
import * as webstore from '@push.rocks/webstore';
|
||||
|
||||
export {
|
||||
smartdelay,
|
||||
|
Reference in New Issue
Block a user