fix(templates): Correct template file paths and organization for service projects

This commit is contained in:
2025-01-01 05:32:10 +01:00
parent 90637b1466
commit 81eb713dee
4 changed files with 12 additions and 5 deletions

View File

@@ -0,0 +1,27 @@
---
fileName: classes.{{module.name}}.ts
---
import * as plugins from './{{module.name}}.plugins.js';
import * as paths from './{{module.name}}.paths.js';
import { {{module.name}}Db } from './classes.{{module.name}}db.js'
export class {{module.name}} {
public projectinfo: plugins.projectinfo.ProjectInfo;
public serverInstance: plugins.loleServiceserver.ServiceServer;
public serviceQenv = new plugins.qenv.Qenv('./', './.nogit');
public {{module.name}}Db: {{module.name}}Db;
public async start() {
this.{{module.name}}Db = new {{module.name}}Db;
this.projectinfo = new plugins.projectinfo.ProjectInfo(paths.packageDir);
this.serverInstance = new plugins.loleServiceserver.ServiceServer({
serviceDomain: '{{module.domain}}',
serviceName: '{{module.name}}',
serviceVersion: this.projectinfo.npm.version,
addCustomRoutes: async (serverArg) => {
// any custom route configs go here
}
});
await this.serverInstance.start();
}
}