Home > Back-end >  What is a specialised framework to develop an API to be deployed in GCP App Engine PHP?
What is a specialised framework to develop an API to be deployed in GCP App Engine PHP?

Time:04-20

I am migrating to AppEngine (Google Cloud Platform) my APIs developed in PHP.

I would like to select a right framework but I couldn't find a specialised one.

CodePudding user response:

You can find a well tested framework in https://github.com/CloudFramework-io/appengine-php-core-7.4

To start a Hello world API just write this (assuming you have installed php 7.x and composer in your localhost)

mkdir {your-directory-project};
cd {your-directory-project};
composer require cloudframework-io/appengine-php-core-7.4
php vendor/cloudframework-io/appengine-php-core-7.4/install.php

It creates a basic structure. And to launch the server and start programming

#first time
composer setup
#every time you want to launch the server
composer serve
> php -S 0.0.0.0:8080 vendor/cloudframework-io/appengine-php-core-7.4/src/dispatcher.php
> [Sun Dec 12 10:42:14 2021] PHP 7.4.26 Development Server
>(http://0.0.0.0:8080) started
> Press Ctrl-C to quit.

Now you can open a browser to:

  • http://localhost:8080/_version
  • http://localhost:8080/traning/hello

You can find further information in its notion page

  • Related