Skip to content

Commit

Permalink
Merge pull request #12 from gentlementlegen/development
Browse files Browse the repository at this point in the history
Manifest file
  • Loading branch information
gentlementlegen authored Jul 17, 2024
2 parents 854a5b9 + 1846155 commit 627caf3
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
11 changes: 11 additions & 0 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "Wallet",
"description": "Allows users to register their wallets to collect rewards.",
"ubiquity:listeners": [ "issue_comment.created" ],
"commands": {
"wallet": {
"ubiquity:example": "/wallet ubq.eth",
"description": "Register your wallet address for payments."
}
}
}
9 changes: 9 additions & 0 deletions src/worker.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
import { Value } from "@sinclair/typebox/value";
import { plugin } from "./plugin";
import { Env, envValidator, pluginSettingsSchema, pluginSettingsValidator } from "./types";
import manifest from "../manifest.json";

export default {
async fetch(request: Request, env: Env): Promise<Response> {
try {
if (request.method === "GET") {
const url = new URL(request.url);
if (url.pathname === "/manifest.json") {
return new Response(JSON.stringify(manifest), {
headers: { "content-type": "application/json" },
});
}
}
if (request.method !== "POST") {
return new Response(JSON.stringify({ error: `Only POST requests are supported.` }), {
status: 405,
Expand Down

0 comments on commit 627caf3

Please sign in to comment.