Skeleton for incredibly simple PHP apps with Routing, DI and Dotenv

Installs: 19

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/lukekortunov/micra

1.2.0 2023-08-03 15:10 UTC

This package is auto-updated.

Last update: 2025-10-01 00:16:26 UTC


README

## Run application
You can manually run app.php by any server you want, but I've packed Makefile to make life easier.
Just execute `make serve` and it will start PHP server on port `8008`.

## HTTP Middlewares

### Authorization middleware
To enable JWT authorization you need to generate RSA keys by executing `make generate-rsa-keys` and uncomment code `// $router->middleware(new \App\Middleware\AuthenticationMiddleware);` in `src/app.php`.
It will add JWT middleware to your request-response flow, so only valid JWTs in headers will be accepted.

Note: To generate JWT token you can use [jwt.io](jwt.io). You need to use RS512 algorithm and paste your public and private keys to the corresponding fields.