Reset repository to README title only
Approach is changing entirely; clearing prior implementation to start over from a clean slate. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -1,58 +0,0 @@
|
||||
import express from 'express'
|
||||
import session from 'express-session'
|
||||
import path from 'node:path'
|
||||
import { fileDir, manifestDir, publicDir, viewsDir } from '../shared/paths'
|
||||
import { ensureProjectFiles } from '../shared/store'
|
||||
import { indexRouter } from './routes/index'
|
||||
import { opRouter } from './routes/op'
|
||||
|
||||
export async function createApp() {
|
||||
await ensureProjectFiles()
|
||||
|
||||
const app = express()
|
||||
app.set('view engine', 'ejs')
|
||||
app.set('views', viewsDir)
|
||||
|
||||
app.use(express.urlencoded({ extended: true }))
|
||||
app.use(express.json())
|
||||
app.use(
|
||||
session({
|
||||
secret: 'mc-custom-suite-session-secret',
|
||||
resave: false,
|
||||
saveUninitialized: false,
|
||||
cookie: {
|
||||
httpOnly: true,
|
||||
sameSite: 'lax'
|
||||
}
|
||||
})
|
||||
)
|
||||
|
||||
app.use('/static', express.static(publicDir))
|
||||
app.use('/manifest', express.static(manifestDir))
|
||||
app.use('/file', express.static(fileDir))
|
||||
|
||||
app.use(indexRouter)
|
||||
app.use(opRouter)
|
||||
|
||||
app.use((error: unknown, _req: express.Request, res: express.Response, _next: express.NextFunction) => {
|
||||
console.error(error)
|
||||
res.status(500).send('서버 내부 오류가 발생했습니다.')
|
||||
})
|
||||
|
||||
return app
|
||||
}
|
||||
|
||||
async function bootstrap() {
|
||||
const app = await createApp()
|
||||
const port = Number(process.env.PORT ?? 3000)
|
||||
app.listen(port, '127.0.0.1', () => {
|
||||
console.log(`Management site listening on http://127.0.0.1:${port}`)
|
||||
})
|
||||
}
|
||||
|
||||
if (require.main === module) {
|
||||
bootstrap().catch((error) => {
|
||||
console.error(error)
|
||||
process.exit(1)
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user