Files
probot/lib/plugins/default.ts
tcbyrd adff1e4cc5 default.js -> default.ts
Changing the name and adding basic types for express
2017-12-17 19:11:06 -05:00

19 lines
481 B
TypeScript

import * as path from 'path'
import * as express from 'express'
export = (robot: any): void => {
const app = robot.route()
app.get('/probot', (req: express.Request, res: express.Response) => {
let pkg
try {
pkg = require(path.join(process.cwd(), 'package.json'))
} catch (e) {
pkg = {}
}
res.render('probot.hbs', pkg)
})
app.get('/', (req: express.Request, res: express.Response, next: express.NextFunction) => res.redirect('/probot'))
}