Skeleton Micropub endpoint
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
"doctrine/orm": "^3.3",
|
||||
"league/commonmark": "^2.7",
|
||||
"league/html-to-markdown": "^5.1",
|
||||
"p3k/micropub": "^0.0.3",
|
||||
"phpdocumentor/reflection-docblock": "^5.6",
|
||||
"phpstan/phpdoc-parser": "^2.1",
|
||||
"symfony/asset": "7.2.*",
|
||||
@@ -77,6 +78,12 @@
|
||||
"symfony/polyfill-php81": "*",
|
||||
"symfony/polyfill-php82": "*"
|
||||
},
|
||||
"repositories": [
|
||||
{
|
||||
"type": "vcs",
|
||||
"url": "https://github.com/aaronpk/p3k-micropub"
|
||||
}
|
||||
],
|
||||
"scripts": {
|
||||
"auto-scripts": {
|
||||
"cache:clear": "symfony-cmd",
|
||||
|
||||
49
symfony/composer.lock
generated
49
symfony/composer.lock
generated
@@ -4,7 +4,7 @@
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "194a6d80a9896ce73994dc1b6c059f1d",
|
||||
"content-hash": "0e4945ad03f5f6c95ed858b69be0e442",
|
||||
"packages": [
|
||||
{
|
||||
"name": "composer/semver",
|
||||
@@ -1975,6 +1975,53 @@
|
||||
},
|
||||
"time": "2025-03-30T21:06:30+00:00"
|
||||
},
|
||||
{
|
||||
"name": "p3k/micropub",
|
||||
"version": "0.0.3",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/aaronpk/p3k-micropub.git",
|
||||
"reference": "9e3b2f7c1d4d40fef5cbd955689b8e7392a6976d"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/aaronpk/p3k-micropub/zipball/9e3b2f7c1d4d40fef5cbd955689b8e7392a6976d",
|
||||
"reference": "9e3b2f7c1d4d40fef5cbd955689b8e7392a6976d",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.6.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^5"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"psr-0": {
|
||||
"p3k": "src/"
|
||||
}
|
||||
},
|
||||
"license": [
|
||||
"Apache-2.0"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Aaron Parecki",
|
||||
"homepage": "https://aaronparecki.com"
|
||||
}
|
||||
],
|
||||
"description": "Utilities to help handle Micropub requests when building servers and clients",
|
||||
"keywords": [
|
||||
"indieweb",
|
||||
"micropub",
|
||||
"p3k"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/aaronpk/p3k-micropub/tree/0.0.3",
|
||||
"issues": "https://github.com/aaronpk/p3k-micropub/issues"
|
||||
},
|
||||
"time": "2018-04-16T14:05:38+00:00"
|
||||
},
|
||||
{
|
||||
"name": "phpdocumentor/reflection-common",
|
||||
"version": "2.2.0",
|
||||
|
||||
@@ -42,6 +42,7 @@ class GuiController extends AbstractController {
|
||||
'description' => 'Joe Carstairs\' personal website',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string,mixed>
|
||||
*/
|
||||
|
||||
29
symfony/src/Controller/MicropubController.php
Normal file
29
symfony/src/Controller/MicropubController.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace App\Controller;
|
||||
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\HttpKernel\Attribute\MapRequestPayload;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use \p3k\Micropub\Request as MicropubRequest;
|
||||
|
||||
class MicropubController extends AbstractController {
|
||||
|
||||
/**
|
||||
* @param $request
|
||||
* @return Response
|
||||
*/
|
||||
#[Route('/micropub', name: 'blog_micropub', methods: ['POST'])]
|
||||
public function blog(
|
||||
#[MapRequestPayload]
|
||||
array $request,
|
||||
): Response {
|
||||
$micropubRequest = MicropubRequest::create($request);
|
||||
return new Response(
|
||||
json_encode($micropubRequest->toMf2()),
|
||||
Response::HTTP_NOT_IMPLEMENTED,
|
||||
['content-type' => 'application/json'],
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,13 @@
|
||||
{
|
||||
"doctrine/deprecations": {
|
||||
"version": "1.1",
|
||||
"recipe": {
|
||||
"repo": "github.com/symfony/recipes",
|
||||
"branch": "main",
|
||||
"version": "1.0",
|
||||
"ref": "87424683adc81d7dc305eefec1fced883084aab9"
|
||||
}
|
||||
},
|
||||
"doctrine/doctrine-bundle": {
|
||||
"version": "2.14",
|
||||
"recipe": {
|
||||
|
||||
Reference in New Issue
Block a user