Skip to content

Feature Request: First Class API Stubs #318

@davemo

Description

@davemo

I wanted to create this to capture the thoughts while they are fresh in my mind after context on a client project where this would have saved some time:

I think we should formalize a config/stubs directory which has the following properties:

  1. is watched for changes to files within, triggering a restart of express on change
  2. captures syntax errors in watched stub files and catches the exception to avoid killing express
  3. (optional) loosely formalize a blessed JSON stub format (simplest thing is module.exports = {} for now), we don't need to get too complicated here
  4. (optional) auto require stubs based on filename such that they are available within config/server.{js,coffee} either as a local in the scope or on the node global object

The first two would be mostly quality of life improvements to the way I use the existing API stubbing feature, the latter two are things that would be really cool if we could make them not suck in implementation ;)

If anyone is willing to pair with me on this, I'd like to start with the first two which are captured in #268.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions