Some reason the serveStatic isn't serving static.
This commit is contained in:
parent
ecbfbd31de
commit
57620a2404
2
src/assets/main.css
Normal file
2
src/assets/main.css
Normal file
@ -0,0 +1,2 @@
|
||||
/* Do something */
|
||||
|
@ -1,4 +1,4 @@
|
||||
export const POST_PATH: string = __dirname + '/../posts';
|
||||
export const STATIC_PATH: string = __dirname + '/../static';
|
||||
export const STATIC_PATH: string = __dirname + '/assets';
|
||||
export const POST_ROUTE_PREFIX: string = '/posts'
|
||||
export const SQLITE_DATABASE_FILE: string = __dirname + '/../db/blog.sqlite';
|
||||
|
@ -1,11 +1,13 @@
|
||||
import { Hono } from 'hono';
|
||||
import { jsxRenderer } from 'hono/jsx-renderer';
|
||||
import { serveStatic } from 'hono/bun';
|
||||
import { Page } from '@blog/templates/Page';
|
||||
import home from '@blog/handlers/home';
|
||||
import posts from '@blog/handlers/posts';
|
||||
import type { SiteMeta } from '@blog/models/SiteMeta';
|
||||
import { postFileMiddleware } from '@blog/middleware/post-service';
|
||||
import { logger } from 'hono/logger';
|
||||
import { STATIC_PATH } from '@blog/config';
|
||||
|
||||
declare module 'hono' {
|
||||
interface ContextRenderer {
|
||||
@ -27,6 +29,8 @@ app.get(
|
||||
)
|
||||
);
|
||||
|
||||
app.get('/static/*', serveStatic({ root: "./assets/" }));
|
||||
|
||||
console.log(JSON.stringify({ message: "Bootstrapping the routes..." }));
|
||||
app.route('/', home);
|
||||
app.route('/posts', posts);
|
||||
|
@ -13,6 +13,7 @@ export function Page({ children, meta }: { children: any, meta: SiteMeta }) {
|
||||
<title>davesmithhayes.com</title>
|
||||
<MetaTags meta={meta} />
|
||||
<Style />
|
||||
<link rel="stylesheet" href="/static/main.css" />
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
|
Loading…
Reference in New Issue
Block a user