mirror of
https://github.com/roleypoly/roleypoly.git
synced 2025-06-18 10:29:08 +00:00
feat: add discord interactions worker
This commit is contained in:
parent
dde05c402e
commit
9354047447
36 changed files with 486 additions and 178 deletions
27
packages/interactions/index.ts
Normal file
27
packages/interactions/index.ts
Normal file
|
@ -0,0 +1,27 @@
|
|||
import { respond } from '@roleypoly/worker-utils';
|
||||
import { Router } from '@roleypoly/worker-utils/router';
|
||||
import { healthz } from './handlers/healthz';
|
||||
import { uiPublicURI } from './utils/config';
|
||||
|
||||
const router = new Router();
|
||||
|
||||
router.add('GET', '/_healthz', healthz);
|
||||
|
||||
// Root Zen <3
|
||||
router.addFallback('root', () => {
|
||||
return respond({
|
||||
__warning: '🦊',
|
||||
this: 'is',
|
||||
a: 'fox-based',
|
||||
web: 'application',
|
||||
please: 'be',
|
||||
mindful: 'of',
|
||||
your: 'surroundings',
|
||||
warning__: '🦊',
|
||||
meta: uiPublicURI,
|
||||
});
|
||||
});
|
||||
|
||||
addEventListener('fetch', (event: FetchEvent) => {
|
||||
event.respondWith(router.handle(event.request));
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue