Skip to content

wfsdaj/core

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Create Micro Web App By webrium-core

  1. install core
composer require webrium/core
  1. create the app Directory

  2. create the index.php file in app

index.php

<?php
require_once __DIR__ . '/../vendor/autoload.php';

use webrium\core\App;
use webrium\core\Debug;
use webrium\core\Route;

Debug::displayErrors(true);

// init index path
App::root(__DIR__);

Route::get('', function ()
{
  return ['message'=>'successful'];
});
  1. create the .htaccess file in app

.htaccess

AddDefaultCharset UTF-8

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ index.php?_url=/$1 [QSA,L]
</IfModule>

Try it now

Output (http://localhost/app/)

{"message":"successful"}

Packages

No packages published

Languages

  • PHP 100.0%