Skip to content

Add rich router example with Response #6

Open

Description

@patrickgwsmith

Include using URLSearchParams

function* GetHealth() {
  yield '/health'

  return async () => {
    const sourceURL =
      'https://cdn.jsdelivr.net/gh/RoyalIcing/yieldmachine@4478530fc40c3bf1208f8ea477f455ad34da308d/readme.md'
    const sourceText = await fetch(sourceURL).then(res => res.text())
    const html = md.render(sourceText)
    return resHTML(html)
  }
}

function* GetWithQuery() {
  yield '/search'
  const [rest] = yield /^[?].+/;
  const query = new URLSearchParams(rest);

  return async () => {
  }
}

Activity

  1. changed the title [-]Add router example[/-] [+]Add rich router example with Response[/+] on Feb 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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