mirror of https://github.com/flightphp/core
parent
d9ec963905
commit
c23d15a9f4
@ -0,0 +1,36 @@
|
||||
# Installation
|
||||
|
||||
1\. [Download](https://github.com/mikecao/flight/tarball/master) and extract the Flight framework files to your web directory.
|
||||
|
||||
2\. Configure your webserver.
|
||||
|
||||
For *Apache*, edit your .htaccess file with the following:
|
||||
|
||||
RewriteEngine On
|
||||
RewriteCond %{REQUEST_FILENAME} !-f
|
||||
RewriteCond %{REQUEST_FILENAME} !-d
|
||||
RewriteRule ^(.*)$ index.php [QSA,L]
|
||||
|
||||
For *Nginx*, add the following to your server declaration:
|
||||
|
||||
server {
|
||||
location / {
|
||||
try_files $uri $uri/ /index.php;
|
||||
}
|
||||
}
|
||||
|
||||
3\. Create your index.php file.
|
||||
|
||||
First include the framework.
|
||||
|
||||
require 'flight/Flight.php';
|
||||
|
||||
Then define a route and assign a function to handle the request.
|
||||
|
||||
Flight::route('/', function(){
|
||||
echo 'hello world!';
|
||||
});
|
||||
|
||||
Finally, start the framework.
|
||||
|
||||
Flight::start();
|
Loading…
Reference in new issue