Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在构建一个具有多个端点的新 Rest 服务,并且还想在同一个实例中支持 GraphQL 端点,是否可以使用 Light-4j 做到这一点?
在 handler.yml 中,您可以定义两个中间件处理程序链。一个用于 REST 端点,一个用于 GraphQL 端点。
这是一个定义了两个链的示例。
https://github.com/networknt/light-config-test/blob/master/light-router/local-portal/config/handler.yml
事实上,对于所有 GraphQL 示例,light-codegen 生成了两个 Rest 端点,用于服务器信息和健康检查。
看看这个例子,你可以添加更多的 Rest 端点。
https://github.com/networknt/light-example-4j/blob/release/graphql/mutation-idl/src/main/resources/config/handler.yml