Remove app directory and simplify project structure

This commit is contained in:
Mauricio Siu
2025-03-01 02:47:32 -06:00
parent 7d1b05ef3f
commit de665b6ed7
8 changed files with 3 additions and 622 deletions

View File

@@ -1,27 +0,0 @@
import { serve } from '@hono/node-server'
import { Hono } from 'hono'
import { serveStatic } from '@hono/node-server/serve-static'
const app = new Hono()
app.use('*', async (c, next) => {
await next()
})
app.use('/templates/*', serveStatic({
root: '../templates',
rewriteRequestPath: (path) => {
return path.replace('/templates/', '')
}
}))
app.get('/', (c) => {
return c.text('Hello Hono!')
})
serve({
fetch: app.fetch,
port: 4000
}, (info) => {
console.log(`Server is running on http://localhost:${info.port}`)
})