You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

11 lines
246 B

  1. module.exports = {
  2. name: 'delayed response',
  3. response: function (ctx) {
  4. return new Promise((resolve, reject) => {
  5. setTimeout(() => {
  6. ctx.body = '<h1>You waited 2s for this</h1>'
  7. resolve()
  8. }, 2000)
  9. })
  10. }
  11. }