Files
probot/lib/plugins/default.js
Jason Etcovitch 5d29945dd2 feat: /probot homepage (#279)
* Add /probot route with tests

* Add index route, write tests

* Remove unused arg

* Pass tests

* Tweak HTML string and pkg require

* Add static directory

* Design welcome page

* Rename to probot.html

* Implement EJS

* Remove duplicate load

* Extract default homepage into plugin

* Fix issue after merge conflict

* Refactor app loading

* Remove autoloading of plugings

BREAKING CHANGE: `probot run` without any arguments will no longer autoload apps named `probot-*`.

* Move setup

* Look for `apps` key instead of `plugins`

* Update simulate command

* Simplify resolver

* Remove unused routes variable

* Move views to default path

* Call probot.setup to properly initialize default apps

* Simplify package loading

* Specify extension

* Add links to docs/slack

* Remove stats link

* Add helper to jest ignore

* Fix ejs views error

* Move a require to top of file

* Remove unnecessary (and breaking) test
2017-10-17 09:35:58 -04:00

17 lines
316 B
JavaScript

const path = require('path')
let pkg
try {
pkg = require(path.join(process.cwd(), 'package.json'))
} catch (e) {
pkg = {}
}
module.exports = robot => {
const app = robot.route()
app.get('/probot', (req, res) => res.render('probot.ejs', pkg))
app.get('/', (req, res, next) => res.redirect('/probot'))
}