fix built files
This commit is contained in:
13
app/bootstrap.php
Normal file
13
app/bootstrap.php
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
// app/bootstrap.php — env + errors
|
||||
$cfg = require __DIR__.'/../config/env.php';
|
||||
|
||||
date_default_timezone_set('UTC');
|
||||
error_reporting(E_ALL);
|
||||
ini_set('display_errors', $cfg['debug'] ? '1' : '0');
|
||||
|
||||
function cfg(string $key, $default=null) {
|
||||
static $cfg;
|
||||
if (!$cfg) $cfg = require __DIR__.'/../config/env.php';
|
||||
return $cfg[$key] ?? $default;
|
||||
}
|
||||
125520
app/data/emojis.json
Normal file
125520
app/data/emojis.json
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
// public/index.php — tiny router
|
||||
require __DIR__.'/../app/bootstrap.php';
|
||||
require __DIR__.'/../app/helpers/cors.php';
|
||||
|
||||
$path = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH) ?: '/';
|
||||
|
||||
// CORS preflight
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'OPTIONS') { cors_preflight(); exit; }
|
||||
|
||||
// Routes (v1)
|
||||
if ($path === '/v1/emojis') { require __DIR__.'/../app/controllers/Emojis.php'; exit; }
|
||||
if (preg_match('#^/v1/emoji/([^/]+)$#', $path)) { $_GET['slug'] = urldecode($GLOBALS['matches'][1] ?? $GLOBALS['1'] ?? ''); require __DIR__.'/../app/controllers/Emojis.php'; exit; }
|
||||
if ($path === '/v1/license/activate') { require __DIR__.'/../app/controllers/License.php'; exit; }
|
||||
if ($path === '/v1/license/verify') { require __DIR__.'/../app/controllers/License.php'; exit; }
|
||||
if ($path === '/v1/license/deactivate') { require __DIR__.'/../app/controllers/License.php'; exit; }
|
||||
|
||||
// Health
|
||||
if ($path === '/v1/health') {
|
||||
header('Content-Type: application/json; charset=utf-8');
|
||||
echo json_encode(['ok'=>true,'time'=>gmdate('c')]);
|
||||
exit;
|
||||
}
|
||||
|
||||
http_response_code(404);
|
||||
header('Content-Type: application/json; charset=utf-8');
|
||||
echo json_encode(['error'=>'not_found','path'=>$path]);
|
||||
Reference in New Issue
Block a user