Created
February 19, 2017 07:23
-
-
Save anonymous/45c2cd05c364f00dbb9347a3c30597a0 to your computer and use it in GitHub Desktop.
Slim Project
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wwwroot/ | |
{ | |
"name": "you-reward/app", | |
"description": "Rewards API for business customers", | |
"license": "proprietary", | |
"require": { | |
"slim/slim": "^3.0", | |
"slim/php-view": "^2.2", | |
"oscarotero/psr7-middlewares": "^3.19" | |
}, | |
"autoload": { | |
"psr-4": { | |
"YouReward\\App\\": "src/" | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wwwroot/ | |
<?php | |
require 'vendor/autoload.php'; | |
use Slim\App; | |
use Slim\Route; | |
use Psr7Middlewares\Middleware\TrailingSlash; | |
$app = new App; | |
$app->add(new TrailingSlash(true)); | |
$app->group('/v1', function() | |
{ | |
new YouReward\App\v1\Controllers\UserController($this); | |
}); | |
$app->run(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wwwroot/src/v1/controllers/UserController.php | |
<?php | |
namespace YouReward\App\v1\Controllers; | |
class UserController{ | |
public function __construct(){ | |
echo 'Hello'; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment