@node-server/renderer
Version:
NodeServerJs is a library with standard feature implemented for web and api
25 lines (19 loc) • 630 B
text/typescript
import { Renderer } from "@node-server/utils";
export class DefaultRenderer extends Renderer {
constructor(config) {
super({
default :{
public_folder : "dist",
default_file : "index.html"
},
userDefined : config
});
}
async Handle(req: any, res: any , next:(any)=> void) {
res.status(200).sendFile(this.GetPathFromRoot(this.pluginConfig.public_folder, this.pluginConfig.default_file),function (err) {
if (err) {
next(err);
}
});
}
}