Sayı

2016-03-27 25 views
0

benim app.yamlSayı

handlers: 

- url: /_ah/spi/websiteapi/.* 
    script: Website.application 
    secure: always 

olarak aşağıda url işleyicisi sahip Ama hatayı alıyorum http://localhost:8080/_ah/api/websiteapi/v1/websites kullanarak api accessiong ederken am uç noktaları { "hata" olarak: { "mesaj": "BackendService.getApiConfigs hata" } } App Engine üzerinde /_ah/spi için

Help me to configure mt url handler and the below setting works fine but i need to handle several scripts depending on the url. 
- url: /_ah/spi/.* 
    script: Website.application 
    secure: always 

cevap

0

talepleri ele alınması gerekir Doğru yanıtları sunmak için bir Google Cloud Uç Noktaları sunucusu tarafından.

Betiğiniz Website.applicationendpoints.api_server nesnesi olmalıdır.

import endpoints 
import services # Your Cloud Endpoints handlers go here. 

endpoints_app = endpoints.api_server([ 
    services.MyService1, 
    services.MyService2 
]) 

Tam belgeler burada: main.py yılında

app.yaml

handlers: 
- url: /_ah/spi/.* 
    script: main.endpoints_app 

yılında: Burada çalışan bir örnektir Bu cevap için çok ince sayesinde çalışıyor https://cloud.google.com/appengine/docs/python/endpoints/getstarted/backend/write_api#coding_a_backend_with_a_simple_get_method

+0

, ama app.yaml dosyasındaki URL işleyicilerinde bu komut dosyasına başvurabileceğimiz herhangi bir yol var. – dhiyan