dousou1878 2018-07-11 15:35
浏览 60
已采纳

谷歌应用程序引擎api_server vs模块

I am developing go api backend using google appengine. When i run the project locally the output says:

INFO 2018-07-11 12:31:17,502 devappserver2.py:120] Skipping SDK update check.
INFO 2018-07-11 12:31:17,576 api_server.py:274] Starting API server at: http://localhost:38628
INFO 2018-07-11 12:31:17,588 dispatcher.py:270] Starting module "default" running at: http://localhost:38629

What is the purpose of two endpoints "API Server" and "module default"? My init is just like this:

http.HandleFunc("/signup", signUp)
http.HandleFunc("/whitelist", whitelist)
http.HandleFunc("/signin", signIn)
http.HandleFunc("/signout", signOut)
  • 写回答

2条回答 默认 最新

  • dongsuiying7773 2018-07-11 18:48
    关注

    Those 2 "endpoints"–or rather servers–serve different purposes.

    First some background:

    "An App Engine app is made up of a single application resource that consists of one or more services." (source) Note: Services were previously called "modules".

    So an app consists of one or multiple services (or modules). If you don't specify services in your app configuration, there is a default service.

    This line:

    Starting module "default" running at: http://localhost:38629
    

    tells a web server has been started that will serve the default service (or module), which is the web server you register your handlers to ("/signup", "/whitelist", etc.).

    The other server:

    Starting API server at: http://localhost:38628
    

    Starts an API server which is not directly used by you. It is an App Engine specific server that acts as a proxy so the local app engine environment can access remote App Engine services (such as Memcache, Datastore) over HTTP. This API server uses the Remote API protocol for communication, and the local dev environment connects to it using HTTP.

    You do not need to worry about this API server, and you do not need to configure it or interact with it. It is part of the App Engine local dev environment which aids to access your remote services, those used by your production environment (should you need it).

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 组策略中的计算机配置策略无法下发
  • ¥15 机器学习简单问题解决
  • ¥15 如何绘制动力学系统的相图
  • ¥15 对接wps接口实现获取元数据
  • ¥20 给自己本科IT专业毕业的妹m找个实习工作
  • ¥15 用友U8:向一个无法连接的网络尝试了一个套接字操作,如何解决?
  • ¥30 我的代码按理说完成了模型的搭建、训练、验证测试等工作(标签-网络|关键词-变化检测)
  • ¥50 mac mini外接显示器 画质字体模糊
  • ¥15 TLS1.2协议通信解密
  • ¥40 图书信息管理系统程序编写