Serve a frontend through Ditto

This commit is contained in:
Alex Gleason 2023-09-11 00:19:56 -05:00
parent 82c4f0827e
commit 8a9f8454bf
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7
3 changed files with 8 additions and 1 deletions

2
public/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
*
!.gitignore

View File

@ -9,6 +9,7 @@ import {
type HonoEnv,
logger,
type MiddlewareHandler,
serveStatic,
} from '@/deps.ts';
import '@/firehose.ts';
@ -155,6 +156,10 @@ app.get('/api/v1/markers', emptyObjectController);
app.get('/api/v1/conversations', emptyArrayController);
app.get('/api/v1/lists', emptyArrayController);
app.get('/packs/*', serveStatic({ root: './public/' }));
app.get('/instance/*', serveStatic({ root: './public/' }));
app.get('*', serveStatic({ path: './public/index.html' }));
app.get('/', indexController);
export default app;

View File

@ -7,7 +7,7 @@ export {
HTTPException,
type MiddlewareHandler,
} from 'https://deno.land/x/hono@v3.3.4/mod.ts';
export { cors, logger } from 'https://deno.land/x/hono@v3.3.4/middleware.ts';
export { cors, logger, serveStatic } from 'https://deno.land/x/hono@v3.3.4/middleware.ts';
export { z } from 'https://deno.land/x/zod@v3.21.4/mod.ts';
export { Author, RelayPool } from 'https://dev.jspm.io/nostr-relaypool@0.6.28';
export {