mirror of
https://github.com/zhigang1992/probot.git
synced 2026-06-13 09:25:20 +08:00
21 lines
554 B
JavaScript
21 lines
554 B
JavaScript
const path = require('path')
|
|
const express = require('express')
|
|
|
|
// Teach express to properly handle async errors
|
|
require('express-async-errors')
|
|
|
|
const logging = require('./middleware/logging')
|
|
|
|
module.exports = function ({webhook, logger}) {
|
|
const app = express()
|
|
|
|
app.use(logging({logger}))
|
|
app.use('/probot/static/', express.static(path.join(__dirname, '..', 'static')))
|
|
app.use(webhook)
|
|
app.set('view engine', 'hbs')
|
|
app.set('views', path.join(__dirname, '..', 'views'))
|
|
app.get('/ping', (req, res) => res.end('PONG'))
|
|
|
|
return app
|
|
}
|