2024-04-25 09:04:10 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
require_once "lib/meme.php";
|
|
|
|
|
|
|
|
function endpoint($endpoint_data): array
|
|
|
|
{
|
|
|
|
|
|
|
|
return match ($endpoint_data["action"]) {
|
2024-04-25 10:19:24 +02:00
|
|
|
"addMeme" => addMeme($endpoint_data['memetitle'], $endpoint_data['memetext'], $endpoint_data['imageid']),
|
2024-04-25 09:40:21 +02:00
|
|
|
"renderGallery" => renderMemeGallery(),
|
2024-04-25 09:04:10 +02:00
|
|
|
default => ["Status" => "Fail", "message" => "Invalid action"],
|
|
|
|
};
|
|
|
|
}
|