
The App Engine development server
The Google Cloud SDK includes development servers for developing App Engine services locally. These development servers aid in development by simulating the App Engine runtime environment, including available services such as Datastore and Task Queues. Additionally, the development servers impose many of the same restrictions on running applications found in App Engine, such as library/module whitelisting. By developing applications within the simulated environment, developers can easily leverage App Engine features and avoid potential runtime issues.
To run this application locally, call the App Engine Python development server with:
dev_appserver.py app.yaml
The Python development server is included in the Google Cloud SDK app-engine-python component. If this is your first time running dev_appserver.py, you'll be prompted to install this component. You may also install it directly by running gcloud components install app-engine-python.
Once started, the development server will serve the service locally at http://localhost:8080. In addition to serving the application, the development server will run an admin server at http://localhost:8000. The admin server provides interfaces for locally available service integrations, allowing users to perform common development tasks such as viewing datastore metrics and data.
Because our application depends on additional services to fulfill /api/colors requests, the UI component will not function correctly when run alone. For now, try hitting http://localhost:8080/admin/env. Notice that the handler for this endpoint contains the login: admin property. This will cause Google to restrict access to the /admin/env endpoint, only allowing users who are members of the Google Cloud project. While not the most robust form of security, the login: admin property provides a simple method for securing certain routes.
Many aspects of building services for the App Engine standard environment are similar across supported languages. Generally, the developer workflow, service architecture, scaling properties, and management processes are the same. Where these languages differ tends to stem from the sandboxed nature of services, language tools, and the maturity of App Engine's support for a given language. A common consideration when looking at the available languages is which service integrations are provided.