mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 11:29:46 +00:00
Let users host arbitrary .well-known paths
This commit is contained in:
parent
d46af51604
commit
e3aed99605
1 changed files with 6 additions and 4 deletions
10
src/app.ts
10
src/app.ts
|
|
@ -169,6 +169,11 @@ const app = new Hono<AppEnv>({ strict: false });
|
|||
|
||||
const debug = Debug('ditto:http');
|
||||
|
||||
/** User-provided files in the gitignored `public/` directory. */
|
||||
const publicFiles = serveStatic({ root: './public/' });
|
||||
/** Static files provided by the Ditto repo, checked into git. */
|
||||
const staticFiles = serveStatic({ root: './static/' });
|
||||
|
||||
app.use('*', rateLimitMiddleware(300, Time.minutes(5)));
|
||||
|
||||
app.use('/api/*', metricsMiddleware, paginationMiddleware, logger(debug));
|
||||
|
|
@ -362,13 +367,10 @@ app.get('/api/v1/conversations', emptyArrayController);
|
|||
app.get('/api/v1/lists', emptyArrayController);
|
||||
|
||||
app.use('/api/*', notImplementedController);
|
||||
app.use('/.well-known/*', notImplementedController);
|
||||
app.use('/.well-known/*', publicFiles, notImplementedController);
|
||||
app.use('/nodeinfo/*', notImplementedController);
|
||||
app.use('/oauth/*', notImplementedController);
|
||||
|
||||
const publicFiles = serveStatic({ root: './public/' });
|
||||
const staticFiles = serveStatic({ root: './static/' });
|
||||
|
||||
// Known frontend routes
|
||||
app.get('/:acct{@.*}', frontendController);
|
||||
app.get('/:acct{@.*}/*', frontendController);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue