2017 © Pedro Peláez
 

silex-gae silex-gae

Create project with Silex for deploy to GAE

image

prawee/silex-gae

Create project with Silex for deploy to GAE

  • Wednesday, October 4, 2017
  • by prawee
  • Repository
  • 1 Watchers
  • 0 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Create project with Silex

Create folder

$ cd /var/www
$ mkdir silex-gae
$ cd silex-gae

Create package.json

$ npm init
# package name: (silex-gae) **enter
# version: (1.0.0) **enter
# description: **Create project with Silex for deploy to GAE
# entry point: (index.js) **index.php
# test command: **enter
# git repository: **https://github.com/prawee/silex-gae.git
# keywords: **GAE,Silex,RESTFul, API
# author: **Prawee Wongsa <prawee@hotmail.com>
# license: (ISC) **MIT
# {.....}
# Is this ok? (yes) **yes

Installation Silex with Composer

$ composer require silex/silex:~2.0
# ./composer.json has been created
# Loading composer repositories with package information
# Updating dependencies (including require-dev)
# ...waiting..
# Writing lock file
# Generating autoload files

Create bootstrap file

# nano index.php

```php <?php /* * Bootstrap file for initial project * @Author: Prawee Wongsa prawee@hotmail.com * @Date: 2017-10-04 15:26:25 * @Last Modified by: Prawee Wongsa * @Last Modified time: 2017-10-04 16:03:29 */, (*1)

/* * Require vendor and dependencies */ require_once DIR.'/vendor/autoload.php';, (*2)

/* * Create an instance */ $app = new Silex\Application();, (*3)

/* * Configuration of instance * Set default developing mode is true */ $app['debug'] = true;, (*4)

/* * Routing */ $app->get('/', function() { return 'Hi! Silex.'; });, (*5)

/* * Run the application */ $app->run(); ```, (*6)

Test

$ php -S localhost:8000
# Please look it on your browser =>  http://localhost:8000

Deploy to Google app engine

$ gcloud auth login
$ gcloud config set project <your-project-id>
$ gcloud app deploy

The Versions

04/10 2017

dev-master

9999999-dev https://github.com/prawee/silex-gae.git

Create project with Silex for deploy to GAE

  Sources   Download

MIT

The Requires

 

api silex restful gae