fix(dependencies): Updated dependencies to latest versions and removed unused service server class

This commit is contained in:
2024-07-23 16:49:24 +02:00
parent 0c0a35bc90
commit 07a3df944a
7 changed files with 4460 additions and 3951 deletions

View File

@ -1,8 +1,8 @@
/**
* autocreated commitinfo by @pushrocks/commitinfo
* autocreated commitinfo by @push.rocks/commitinfo
*/
export const commitinfo = {
name: '@serve.zone/platformclient',
version: '1.0.4',
version: '1.0.5',
description: 'a module that makes it really easy to use the serve.zone platform inside your app'
}

View File

@ -1,51 +0,0 @@
import * as plugins from './plugins.js';
import { InfoHtml } from './infohtml/index.js';
export interface IServiceServerConstructorOptions {
addCustomRoutes?: (serverArg: plugins.typedserver.servertools.Server) => Promise<any>;
serviceName: string;
serviceVersion: string;
serviceDomain: string;
port?: number;
}
/**
* a server for serving your app to the outside world
*/
export class ServiceServer {
public options: IServiceServerConstructorOptions;
public typedServer: plugins.typedserver.TypedServer;
constructor(optionsArg: IServiceServerConstructorOptions) {
this.options = optionsArg;
}
public async start() {
console.log('starting lole-serviceserver...')
this.typedServer = new plugins.typedserver.TypedServer({
cors: true,
domain: this.options.serviceDomain,
forceSsl: false,
port: this.options.port || 3000,
robots: true,
defaultAnswer: async () => {
return (
await InfoHtml.fromSimpleText(
`${this.options.serviceName} (version ${this.options.serviceVersion})`
)
).htmlString;
},
});
// lets add any custom routes
if (this.options.addCustomRoutes) {
await this.options.addCustomRoutes(this.typedServer.server);
}
await this.typedServer.start();
}
public async stop() {
await this.typedServer.stop();
}
}

View File

@ -1,7 +1,6 @@
export * from './classes.serviceserver.js';
export * from './classes.platformclient.js';
// Things for building a server
import { servertools } from '@api.global/typedserver';
const { Handler, HandlerTypedRouter } = servertools;
export { Handler, HandlerTypedRouter };
import { servertools, utilityservers } from '@api.global/typedserver';