Insperienced by http://adam.merrifield.ca/2014/10/07/yeoman-angularjs-and-php/
- yo angular
- npm install grunt-php --save-dev
- replace all 'connect' with 'php' inside gruntfile.
- add php.options.base = "app"
- add php.options.router = "../router.php"
- create router.php
<?php
// router.php
if (preg_match('/\/bower_components\/.*.css/', $_SERVER["REQUEST_URI"])) {
header("Content-Type: text/css");
} elseif (preg_match('/\/bower_components\/.*.css/', $_SERVER["REQUEST_URI"])) {
header("Content-Type: application/js");
}
if (preg_match('/\/bower_components\/.*/', $_SERVER["REQUEST_URI"])) {
readfile(".." . $_SERVER["REQUEST_URI"]);
} elseif (preg_match('/bower_components\/.*/', $_SERVER["REQUEST_URI"])) {
readfile("../" . $_SERVER["REQUEST_URI"]);
} else {
return false;
}
- go to app folder
- composer create-project slim/slim-skeleton api
- go to api
- composer require entomb/slim-json-api