https://github.com/citguru/bryss
Bryss is a PHP micro framework that helps you quickly write simple yet powerful RESTful APIs.
https://github.com/citguru/bryss
api framework php restful-api
Last synced: 25 days ago
JSON representation
Bryss is a PHP micro framework that helps you quickly write simple yet powerful RESTful APIs.
- Host: GitHub
- URL: https://github.com/citguru/bryss
- Owner: CITGuru
- License: mit
- Created: 2020-08-23T18:59:45.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-08-24T16:47:38.000Z (over 5 years ago)
- Last Synced: 2025-03-23T18:54:20.755Z (about 1 year ago)
- Topics: api, framework, php, restful-api
- Language: PHP
- Homepage:
- Size: 20.5 KB
- Stars: 13
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Bryss Framework

Bryss is a PHP micro framework that helps you quickly write simple yet powerful RESTful APIs inspired by Express and Slim (read the source code by heart). Bryss is built from ground up and no dependencies used currently.
* This is still in its early development used with care *
## Installation
It's recommended that you use [Composer](https://getcomposer.org/) to install Bryss.
```bash
$ composer require citguru/bryss:dev-master
```
*This project is still in development and no stable version yet. You can install by using the :dev-master tag. You should be able to install without it once there's a stable release*
This will install Bryss. Bryss have supports for PHP version from 5.3.0 to the latest ones.
You can also clone this repo directly to your project folder and require the needed classes.
## Usage
Simple HelloWorld impelmentation of Bryss Framework.
```php
get("/hello", function($req, $res){
return $res->json(array(
"message"=>"Hello World"
));
});
$app->get('/hello-xml', function($req, $res, $args) {
return $res->xml(array(
"message" => "Hello World",
"author" => "Ilori Stephen A "
));
});
$app->get("/hello/:name", function($req, $res){
$name = $req->params["name"];
return $res->json(array(
"message"=>"Hello World, ".$name
), 201);
});
?>
```
You can quickly test this using the built-in PHP server:
```bash
$ php -S localhost:8000 -t public
```
Going to http://localhost:8000/hello/, http://localhost:8000/hello-xml/ or http://localhost:8000/hello/:name would return:
```json
{
"message": "Hello World"
}
```
```xml
Hello World
Ilori Stephen A
```
```json
{
"message": "Hello World, "
}
```
## Deployment
If you have Apache/Nginx and PHP setup either on your own server or shared hosting, you can easily use `.htaccess` to route all requests to an entry file which is usually `index.php`.
```
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?path=$1 [NC,L,QSA]
```
or
```
RewriteEngine on
RewriteRule ^$ public/ [L]
RewriteRule (^[^/]*$) public/$1 [L]
```
This means you would need to upload your Bryss project and all other files to the `public` or any folder you want (you will need to switch it out in the htaccess) to use. You will probably use FTP to upload it.
## Documentation
Coming soon... For the main time kindly check [public/index](public/index.php) for how to use it.
## Contributions
Please see [CONTRIBUTION](CONTRIBUTION.md) for details.
## Security
If you discover security related issues, please email me : oyetoketoby80@gmail.com
## License
Copyright (c) 2020 Oyetoke Toby (twitter: @oyetokeT)
The Bryss Framework is licensed under the MIT license. See [License File](LICENSE.md) for more information.