- StoreForge API: e-commerce site generator via WEVIA - LeadForge API: B2B lead generation + ICP + sequences - ProposalAI API: commercial proposal generator - BlueprintAI API: process/architecture document generator - MailWarm API: email warmup status/start/history - OutreachAI API: cold outreach sequences + subject lines - FormBuilder API: AI form generator - EmailVerify API: email validation (MX, disposable, format) - Auth OTP: replaces email-only auth with OTP/magic-link - SQL migration: auth_otp + auth_attempts tables - WEVIA proxy library: routes all AI calls through server-side Ollama - Auth library: API key validation + rate limiting via Redis Co-authored-by: Yacineutt <Yacineutt@users.noreply.github.com>
57 lines
1.8 KiB
PHP
57 lines
1.8 KiB
PHP
<?php
|
|
/**
|
|
* WEVAL SaaS API Router
|
|
* Central router for all SaaS product APIs
|
|
* Deploy to: /var/www/weval/api/products/
|
|
*/
|
|
|
|
header('Content-Type: application/json; charset=utf-8');
|
|
header('Access-Control-Allow-Origin: https://weval-consulting.com');
|
|
header('Access-Control-Allow-Methods: POST, GET, OPTIONS');
|
|
header('Access-Control-Allow-Headers: Content-Type, X-API-Key');
|
|
header('X-Content-Type-Options: nosniff');
|
|
header('X-Frame-Options: DENY');
|
|
header('Strict-Transport-Security: max-age=31536000; includeSubDomains');
|
|
|
|
if ($_SERVER['REQUEST_METHOD'] === 'OPTIONS') {
|
|
http_response_code(204);
|
|
exit;
|
|
}
|
|
|
|
$uri = $_SERVER['REQUEST_URI'];
|
|
$method = $_SERVER['REQUEST_METHOD'];
|
|
|
|
$routes = [
|
|
'/api/storeforge/generate' => 'storeforge/api.php',
|
|
'/api/leadforge/generate' => 'leadforge/api.php',
|
|
'/api/proposalai/generate' => 'proposalai/api.php',
|
|
'/api/blueprintai/generate' => 'blueprintai/api.php',
|
|
'/api/mailwarm/status' => 'mailwarm/api.php',
|
|
'/api/outreachai/generate' => 'outreachai/api.php',
|
|
'/api/formbuilder/generate' => 'formbuilder/api.php',
|
|
'/api/emailverify/check' => 'emailverify/api.php',
|
|
];
|
|
|
|
$matched = false;
|
|
foreach ($routes as $route => $handler) {
|
|
if (strpos($uri, $route) === 0) {
|
|
$handlerPath = __DIR__ . '/' . $handler;
|
|
if (file_exists($handlerPath)) {
|
|
require_once $handlerPath;
|
|
} else {
|
|
http_response_code(501);
|
|
echo json_encode(['error' => 'Service en cours de deploiement', 'service' => basename(dirname($handler))]);
|
|
}
|
|
$matched = true;
|
|
break;
|
|
}
|
|
}
|
|
|
|
if (!$matched) {
|
|
http_response_code(404);
|
|
echo json_encode([
|
|
'error' => 'Endpoint non trouve',
|
|
'available' => array_keys($routes)
|
|
]);
|
|
}
|