mirror of https://github.com/embarklabs/embark.git
21 lines
378 B
JavaScript
21 lines
378 B
JavaScript
|
class LoggerApi {
|
||
|
constructor(embark) {
|
||
|
this.embark = embark;
|
||
|
this.logger = embark.logger;
|
||
|
|
||
|
this.registerAPICalls();
|
||
|
}
|
||
|
|
||
|
registerAPICalls(){
|
||
|
this.embark.registerAPICall(
|
||
|
'get',
|
||
|
'/embark-api/process-logs/embark',
|
||
|
(req, res) => {
|
||
|
res.send(this.logger.parseLogFile(req.query.limit));
|
||
|
}
|
||
|
);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
module.exports = LoggerApi;
|