Skip to content

Commit 778f26a

Browse files
authored
Merge pull request #122 from slimphp/FixMultipleIssues
Fix Multiple Issues
2 parents 6a570ae + ec504de commit 778f26a

4 files changed

Lines changed: 14 additions & 6 deletions

File tree

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,10 @@ composer start
2525
```
2626

2727
Or you can use `docker-compose` to run the app with `docker`, so you can run these commands:
28-
29-
cd [my-app-name]
30-
docker-compose up -d
28+
```bash
29+
cd [my-app-name]
30+
docker-compose up -d
31+
```
3132
After that, open `http://0.0.0.0:8080` in your browser.
3233

3334
Run this command in the application directory to run the test suite

app/routes.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,19 @@
33

44
use App\Application\Actions\User\ListUsersAction;
55
use App\Application\Actions\User\ViewUserAction;
6+
use Psr\Http\Message\ResponseInterface as Response;
7+
use Psr\Http\Message\ServerRequestInterface as Request;
68
use Slim\App;
79
use Slim\Interfaces\RouteCollectorProxyInterface as Group;
810

911
return function (App $app) {
1012
$container = $app->getContainer();
1113

14+
$app->get('/', function (Request $request, Response $response) {
15+
$response->getBody()->write('Hello world!');
16+
return $response;
17+
});
18+
1219
$app->group('/users', function (Group $group) use ($container) {
1320
$group->get('', ListUsersAction::class);
1421
$group->get('/{id}', ViewUserAction::class);

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
"monolog/monolog": "^1.24",
2222
"php": ">=7.1",
2323
"php-di/php-di": "^6.0",
24-
"slim/psr7": "dev-master",
25-
"slim/slim": "^4"
24+
"slim/psr7": "^0.5",
25+
"slim/slim": "^4.1"
2626
},
2727
"require-dev": {
2828
"phpunit/phpunit": "^7.5"

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: '2'
1+
version: '3.7'
22

33
volumes:
44
logs:

0 commit comments

Comments
 (0)