PHP Classes

File: backend/index.php

Recommend this page to a friend!
  Classes of Rodrigo Faustino   Micro-Blog   backend/index.php   Download  
File: backend/index.php
Role: Example script
Content type: text/plain
Description: Blog router script
Class: Micro-Blog
Blog management system extensible with classes
Author: By
Last change:
Date: 2 days ago
Size: 438 bytes
 

Contents

Class file image Download
<?php
namespace Backend\Api;
use
Backend\Api\Rotas\Router;
use
Backend\Api\Http\HttpHeader;
use
Backend\Api\Rotas\Rotas;

require_once
'../vendor/autoload.php';

HttpHeader::setDefaultHeaders();

if (
$_SERVER['REQUEST_METHOD'] === 'OPTIONS') {
   
http_response_code(204);
    exit();
}

$method = $_SERVER['REQUEST_METHOD'];
$uri = $_SERVER['REQUEST_URI'];

$arrayRotas = Rotas::fastRotas();

Router::resolve($arrayRotas, $method, $uri);