Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/mathleite/simple-php-router

Simple router usage with PHP7.4, Docker, Nginx and Postgres
https://github.com/mathleite/simple-php-router

composer docker docker-compose illuminate-database nginx php-router php7 phpfpm postgres postgresql router slack slack-webhook webhooks

Last synced: about 10 hours ago
JSON representation

Simple router usage with PHP7.4, Docker, Nginx and Postgres

Awesome Lists containing this project

README

        

Simple PHP Router



Workflow badge



SETUP

Nginx
PHP8
Docker

#### Start app
- Build Docker containers
```docker
docker-compose up --build -d
```

- Install Composer dependencies
```docker
docker exec -it php composer install
```

### Create your own routes

`app/Route/index.php`

```php
$route->registry('/greet', \App\Greet\GreetController::class, 'index');
```

Where:
- `/user` is the **route** that you want to *register*;
- `\App\Greet\GreetController::class` is the *Controller* **namespace**;
- `index` is a controller *function*