Cloud Endpoints with Multiple Services Classes

后端 未结 5 730
梦谈多话
梦谈多话 2021-01-03 02:51

I am starting to use Google Cloud Endpoints and I am running in a problem when specifying multiple services classes. Any idea how to get this working?

ApiCon         


        
5条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-03 03:45

    I've managed to successfuly deploy single api implemented in two classes. You can try using following snippet (almost directly from google documentation):

    an_api = endpoints.api(name='library', version='v1.0')
    
    @an_api.api_class(resource_name='shelves')
    class Shelves(remote.Service):
    ...
    
    @an_api.api_class(resource_name='books', path='books')
    class Books(remote.Service):
    ...
    
    APPLICATION = endpoints.api_server([an_api],
                                   restricted=False)
    

提交回复
热议问题