mirror of
https://github.com/Dokploy/templates
synced 2025-06-26 18:16:07 +00:00
Remove app directory and simplify project structure
This commit is contained in:
@@ -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}`)
|
||||
})
|
||||
Reference in New Issue
Block a user