14 lines
440 B
PHP
14 lines
440 B
PHP
<?php
|
|
|
|
require_once "lib/meme.php";
|
|
|
|
function endpoint($endpoint_data): array
|
|
{
|
|
|
|
return match ($endpoint_data["action"]) {
|
|
"addMeme" => addMeme($endpoint_data['meme_title'], $endpoint_data['meme_text'], $endpoint_data['meme_image_id']),
|
|
"renderGallery" => renderMemeGallery(),
|
|
"deleteMeme" => deleteMeme($endpoint_data['meme_id']),
|
|
default => ["Status" => "Fail", "message" => "Invalid action"],
|
|
};
|
|
} |