Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/prawee/silex-gae

Silex with Google App Engine
https://github.com/prawee/silex-gae

api php restful restful-webservices silex

Last synced: about 11 hours ago
JSON representation

Silex with Google App Engine

Awesome Lists containing this project

README

        

# Create project with Silex

### Create folder
```bash
$ cd /var/www
$ mkdir silex-gae
$ cd silex-gae
```

### Create package.json
```bash
$ 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
# license: (ISC) **MIT
# {.....}
# Is this ok? (yes) **yes
```

### Installation Silex with Composer
```bash
$ 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
```bash
# nano index.php
```
```php
get('/', function() {
return 'Hi! Silex.';
});

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

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

### Deploy to Google app engine
```bash
$ gcloud auth login
$ gcloud config set project
$ gcloud app deploy
```