Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/omarmakled/symfony5-demo
A symfony5 demo app with api and command example
https://github.com/omarmakled/symfony5-demo
api command docker php8 phpunit symfony5
Last synced: about 2 months ago
JSON representation
A symfony5 demo app with api and command example
- Host: GitHub
- URL: https://github.com/omarmakled/symfony5-demo
- Owner: OmarMakled
- License: mit
- Created: 2022-07-25T10:35:26.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-08-23T06:05:26.000Z (over 2 years ago)
- Last Synced: 2023-03-05T23:45:05.626Z (almost 2 years ago)
- Topics: api, command, docker, php8, phpunit, symfony5
- Language: PHP
- Homepage:
- Size: 57.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Installation
```
make run && make install
```## Run commands inside the container
```
make enter
```## Run tests
```
make test
``````
Import Logs Command (App\Tests\Functional\Controller\ImportLogsCommand)
✔ Import all logs
✔ Import logs fromApi Controller (App\Tests\Functional\Controller\ApiController)
✔ Get count on success
✔ Get count bad input parameterHealth Check Controller (Tests\Functional\Controller\HealthCheckController)
✔ Health z endpointLog Request (Tests\Unit\Request\LogRequest)
✔ Get service names
✔ Get status code
✔ Get start and end dateLog Parser (Tests\Unit\Service\LogParser)
✔ Get service
✔ Get date
✔ Get request
✔ Parse
✔ FillLog Reader (Tests\Unit\Service\LogReader)
✔ Open wrong file
✔ Open and read
✔ Open and read offsetTime: 00:03.921, Memory: 30.00 MB
OK (16 tests, 42 assertions)
```## Import logs file "inside container"
```
./bin/console app:import logs.txt
./bin/console app:import logs.txt 2 // Import from specific line
```## Api
`GET http://localhost:9002/count`
| Param | Type | Example | Required |
|--------------|-----------|------------|------------|
| startDate | datetime | startDate=2021-08-17 09:21:53 | optional
| endDate | datetime | endDate=2021-08-17 09:21:53 | optional
| statusCode | int | statusCode=200 | optional
| serviceNames | string, array | serviceNames=foo,bar serviceNames[]=foo&servicesName[]=bar | optional**Success 200**
```
{
"counter": 0
}
```**Invalid parameter 400**
"bad input parameter"## Fixtures
```
make fixtures
```Happy Code!