29 lines
722 B
TypeScript
29 lines
722 B
TypeScript
import {Template} from "../Template"
|
|
import {UniversalPath} from "@extollo/util"
|
|
|
|
const middleware_template: Template = {
|
|
name: 'middleware',
|
|
fileSuffix: '.middleware.ts',
|
|
description: 'Create a middleware class that can be applied to routes.',
|
|
baseAppPath: ['http', 'middlewares'],
|
|
render(name: string, fullCanonicalName: string, targetFilePath: UniversalPath) {
|
|
return `import {Middleware} from "@extollo/lib"
|
|
import {Injectable} from "@extollo/di"
|
|
|
|
/**
|
|
* ${name} Middleware
|
|
* --------------------------------------------
|
|
* Put some description here.
|
|
*/
|
|
@Injectable()
|
|
export class ${name} extends Middleware {
|
|
public async apply() {
|
|
|
|
}
|
|
}
|
|
`
|
|
}
|
|
}
|
|
|
|
export { middleware_template }
|