<?php

/** @var $f3 \Base */
$f3=require('../f3/lib/base.php');

//Config
$f3->config('../config.php');
$f3->config('apiconfig.php');

//Routes
$f3->route('GET /index.php?js&a&@code', 'Js->getAd');
$f3->route('GET /index.php?js&g&@code', 'Js->getGroup');
$f3->route('GET /index.php?js&s&@code', 'Js->getSale');
$f3->route('GET /index.php?js&ka&@code', 'Js->getKeywordAd');
$f3->route('GET /index.php?js&kg&@code', 'Js->getKeywordGroup');

$f3->route('GET /index.php?js&a&@code&@version', 'Js->getAd');
$f3->route('GET /index.php?js&g&@code&@version', 'Js->getGroup');
$f3->route('GET /index.php?js&s&@code&@version', 'Js->getSale');
$f3->route('GET /index.php?js&ka&@code&@version', 'Js->getKeywordAd');
$f3->route('GET /index.php?js&kg&@code&@version', 'Js->getKeywordGroup');

$f3->route('GET /index.php?in&a*', 'In->getAd');
$f3->route('GET /index.php?in&g*', 'In->getGroup');
$f3->route('GET /index.php?in&s*', 'In->getSale');
$f3->route('GET /index.php?in&ka*', 'In->getKeywordsAd');
$f3->route('GET /index.php?in&kg*', 'In->getKeywordsGroup');

$f3->route('GET /index.php?in&v&a&@id', 'In->getVASTAd');
$f3->route('GET /index.php?in&v&g&@id', 'In->getVASTGroup');
$f3->route('GET /index.php?in&v&a&i&@id', 'In->setVASTAdImpression');
$f3->route('GET /index.php?in&v&a&c&@id', 'In->setVASTAdClick');

$f3->route('GET /index.php?in&t&a&@id', 'In->getTrackingPixel');

$f3->route('GET /index.php?out&a&@id', 'Out->processAdClick');

$f3->route('GET /index.php?pq', 'Queue->processQueue');
$f3->route('GET /index.php?scheduler', 'Scheduler->processSchedule');

//Start F3
$f3->run();
