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 matlab实现基于主成分变换的图像融合。
  • ¥15 对于相关问题的求解与代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料
  • ¥15 使用R语言marginaleffects包进行边际效应图绘制
  • ¥20 usb设备兼容性问题
  • ¥15 错误(10048): “调用exui内部功能”库命令的参数“参数4”不能接受空数据。怎么解决啊