mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 13:59:16 +01:00
refactor: 🚚 Organize code into sub-packages, instead of a single large package
This commit is contained in:
parent
79742f47dc
commit
a6d3ebbeef
366 changed files with 942 additions and 833 deletions
28
packages/api/routes/messaging/index.ts
Normal file
28
packages/api/routes/messaging/index.ts
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
import { getLogger } from "@logtape/logtape";
|
||||
import chalk from "chalk";
|
||||
import { describeRoute } from "hono-openapi";
|
||||
import { apiRoute } from "@/api";
|
||||
|
||||
export default apiRoute((app) =>
|
||||
app.post(
|
||||
"/messaging",
|
||||
describeRoute({
|
||||
summary: "Endpoint for the Instance Messaging Versia Extension.",
|
||||
description: "https://versia.pub/extensions/instance-messaging.",
|
||||
tags: ["Federation"],
|
||||
responses: {
|
||||
200: {
|
||||
description: "Message saved",
|
||||
},
|
||||
},
|
||||
}),
|
||||
async (context) => {
|
||||
const content = await context.req.text();
|
||||
|
||||
getLogger(["federation", "messaging"])
|
||||
.info`Received message via ${chalk.bold("Instance Messaging")}:\n${content}`;
|
||||
|
||||
return context.text("", 200);
|
||||
},
|
||||
),
|
||||
);
|
||||
Loading…
Add table
Add a link
Reference in a new issue