PHPackages                             fyyb/express - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. fyyb/express

ActiveLibrary[Framework](/categories/framework)

fyyb/express
============

PHP micro framework that helps you quickly write simple yet powerful web applications and APIs.

2.0.4(4y ago)354MITPHPPHP &gt;=7.0

Since Jan 24Pushed 4y agoCompare

[ Source](https://github.com/FYYB/express)[ Packagist](https://packagist.org/packages/fyyb/express)[ RSS](/packages/fyyb-express/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (1)Versions (7)Used By (0)

Fyyb Express
============

[](#fyyb-express)

> PHP micro framework that helps you quickly write simple yet powerful web applications and APIs.

Getting started
---------------

[](#getting-started)

### Installation

[](#installation)

Assuming you already have composer knowledge, create a directory to store your application and make it your working directory.

```
$ composer require fyyb/express

```

This will include in composer autoload all the necessary dependencies. Requires PHP 7.0 or later!

### Usage example

[](#usage-example)

After installing, create the .htacces, config.php and index.php files at the root of your project.

To keep your code separate from the configuration files, we suggest that you use a folder/file structure similar to the one below:

```
   .
   ├─ App/
   │    └── ...
   ├─ vendor/
   │    └── ...
   ├─ .htaccess
   ├─ config.php
   ├─ index.php
   └─ composer.json

```

Don't forget to add your application's namespace in the autoload of the composer.json.

```
    "autoload": {
        "psr-4": {
            "App\\": "App/"
        }
    },
```

### .htaccess

[](#htaccess)

To use fyyb/express, it is necessary to redirect all navigation to the root file (index.php), where all traffic must be handled. The example below shows how:

```
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [QSA]

```

### config.php

[](#configphp)

File where the variables/constants of the project will be defined. If your project directory is different from the root, configure the BASE\_DIR constant for the correct operation in identifying the routes.

```
