Co-authored-by: Andrew Eisenberg <aeisenberg@github.com> Co-authored-by: Henry Mercer <henrymercer@github.com>
47 lines
1.6 KiB
JavaScript
47 lines
1.6 KiB
JavaScript
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.createGateway = void 0;
|
|
const index_1 = require("../index");
|
|
const path_to_regexp_1 = require("path-to-regexp");
|
|
function createGateway() {
|
|
return new index_1.Gateway({
|
|
post: [
|
|
{
|
|
packageName: "twirp.example.haberdasher",
|
|
methodName: "MakeHat",
|
|
serviceName: "Haberdasher",
|
|
httpMethod: "post",
|
|
matchingPath: "/hat{:query_string(\\?.*)}?",
|
|
matcher: path_to_regexp_1.match("/hat{:query_string(\\?.*)}?"),
|
|
bodyKey: "*",
|
|
responseBodyKey: "",
|
|
},
|
|
],
|
|
get: [
|
|
{
|
|
packageName: "twirp.example.haberdasher",
|
|
methodName: "FindHat",
|
|
serviceName: "Haberdasher",
|
|
httpMethod: "get",
|
|
matchingPath: "/hat/{:hat_id}{:query_string(\\?.*)}?",
|
|
matcher: path_to_regexp_1.match("/hat/{:hat_id}{:query_string(\\?.*)}?"),
|
|
bodyKey: "",
|
|
responseBodyKey: "",
|
|
},
|
|
{
|
|
packageName: "twirp.example.haberdasher",
|
|
methodName: "ListHat",
|
|
serviceName: "Haberdasher",
|
|
httpMethod: "get",
|
|
matchingPath: "/hat{:query_string(\\?.*)}?",
|
|
matcher: path_to_regexp_1.match("/hat{:query_string(\\?.*)}?"),
|
|
bodyKey: "",
|
|
responseBodyKey: "",
|
|
},
|
|
],
|
|
put: [],
|
|
patch: [],
|
|
delete: [],
|
|
});
|
|
}
|
|
exports.createGateway = createGateway;
|