Skip to main content
Version: v0.x

Only match some request methods

In some cases, you may want to create a Route that only matches certain request methods. Let's say we're serving a static response that should only be available on a GET request.

const routes = [
from: {
pattern: "",
methods: ["GET"],
to: {
text: "User-agent: Googlebot\nDisallow: /nogooglebot/\nUser-agent: *\nAllow: /\n",

Any valid HTTP request method can be added to Route["from.methods"] to prevent it from matching requests with unlisted methods.