fix(templates): Correct template file paths and organization for service projects
This commit is contained in:
27
assets/templates/service/ts/classes.some.ts
Normal file
27
assets/templates/service/ts/classes.some.ts
Normal 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();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user