Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Routing - includes #28

Open
jackbridger opened this issue Jul 26, 2019 · 1 comment
Open

Routing - includes #28

jackbridger opened this issue Jul 26, 2019 · 1 comment

Comments

@jackbridger
Copy link

This is something we thought about (and couldn't do)

You used:

if (endpoint === "/") {
    handlers.handleHome(request, response);
  } else if (endpoint.includes("public")) {
    handlers.handlePublic(request, response, endpoint);
  } else if (endpoint.includes("query")) {
    console.log("This is search endpoint: ", endpoint);
    handlers.handleCall(request, response, endpoint);
  } else {
    response.writeHead(404);
    response.end("404 Page not found");
  }

But for example if someone made a query that included the word 'Public' - would it evaluate correctly?

@jackbridger
Copy link
Author

think this could work

.startsWith("/public") 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant