diff --git a/public/.gitignore b/public/.gitignore new file mode 100644 index 0000000..c96a04f --- /dev/null +++ b/public/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore \ No newline at end of file diff --git a/src/app.ts b/src/app.ts index 129b302..33592e3 100644 --- a/src/app.ts +++ b/src/app.ts @@ -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; diff --git a/src/deps.ts b/src/deps.ts index 99e8c4f..a31d988 100644 --- a/src/deps.ts +++ b/src/deps.ts @@ -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 {