Skip to content

Make GET /probot template more flexible #53

@swain

Description

@swain

As is, the behavior of the GET /probot HTML template is brittle and non-flexible:

// views/probot.js
const { name, version } = require(`${process.cwd()}/package`);

module.exports.template = `
  ... 
`

// index.js
const { template } = require("./views/probot");
...

// `template` is rendered on `GET /probot`
  1. It relies on the presence of a package module in process.cwd() at import time. This reliance seems unnecessary, and is also undocumented in the README.

  2. This require statement is not compatible with webpack, which cannot handle a dynamic import like this.

Thoughts on updating this behavior to be configurable, or swapping the require for a safer file read?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions