基于金字塔的minty http api服务器

minty-pyramid的Python项目详细描述


金字塔配置库minty python(micro)服务。

入门

视图:

def hello(request):
  # See minty package for more information about these domain classes:
  domain_query_instance = request.get_query_instance("YourDomainHere")
  return domain_query_instance.some_domain_query()

主要:

def main(*args, **kwargs):
  # See minty package for more information about these domain classes:
  loader = minty_pyramid.Engine(domains=[YourDomainHere])

  # [optional] To retrieve session information, make sure  to add before
  # running loader.setup()
  kwargs["session_manager"] = True

  # Ensure the "get_query_instance" request method is available
  # It will use a CQRS instance, built with an InstanceConfig built from
  # the configuration file specified in the file pointed to by
  # "minty_service.infrastructure.config_file" in kwargs
  config = loader.setup(*args, **kwargs)

  config.add_route("hello_world", "/hello")
  config.add_view(
      hello, request_method="GET", renderer="json", route_name="hello_world"
      )

  # If you've created the app from an openapi-spec file make sure to add:
  routes.add_routes(config)

  # Returns a WSGI application
  return loader.main()
代码生成命令:
生成视图:使用“生成视图”命令创建样板视图。

从openapi(v3)规范文件运行创建应用程序时 “generate views”为所有视图创建带有样板代码的“views.py”文件 在OpenAPI规范中指定。

有关详细信息,请参见“生成视图–帮助”

生成路由:使用“生成路由”命令创建路由。

从OpenAPI规范文件生成或重新生成“routes.py”文件。

有关详细信息,请参见“生成路线–帮助”

更多文档

有关此操作的详细信息,请参阅通过CI生成的文档 模块以及如何在我们的在线文档中做出贡献打开index.html 当你到达那里: https://gitlab.com/minty-python/minty-pyramid/-/jobs/artifacts/master/browse/tmp/docs?job=qa

贡献

请阅读CONTRIBUTING.md 有关我们的行为准则以及向我们提交请求的过程的详细信息。

版本控制

我们使用SemVer进行版本控制。对于版本 可用,请参阅 tags on this repository

许可证

版权所有(c)2018,Minty Team和 CONTRIBUTORS

这个项目是根据EUPL,v1.2授权的见 EUPL-1.2.txt 文件以获取详细信息。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java CXF和授权   java在网站中部署使用swing创建的表单   java为什么getHeaderField()返回一个字符串,其中getHeaderFields()返回HttpUrlConnection中的Map<String,List<String>>   java如何检测恶意数据包?   webview中的java网页为空   java SWT图像资源,用于将我的所有图像存储在一个位置   java计算数组的最大长度,使平均值小于给定值   java“发件人电话号码无效”和美国号码   将Swing组件作为内容的自定义Java工具提示不会显示   在并发HashMap中重新灰化期间的java检索   Java 7和Tomcat 7.0.64 ClassFormatException:常量池中的字节标记无效   使用JUnit的java assertNull因NullPointerException失败   java内存中的文件是否与文件系统中的文件大小相同?   循环内实例化的类型的java注入依赖项