27 lines
		
	
	
		
			996 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			27 lines
		
	
	
		
			996 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
---
 | 
						|
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();
 | 
						|
  }
 | 
						|
} |