Build installer and management site from spec

This commit is contained in:
2026-05-07 23:22:34 +09:00
parent 0b061e63b7
commit af6e559682
33 changed files with 7125 additions and 1 deletions

View File

@@ -0,0 +1,31 @@
import { Router } from 'express'
import path from 'node:path'
import { manifestRootPath } from '../../shared/paths'
import { fetchReleaseVersions } from '../../shared/mojang'
import { loadRootManifest } from '../../shared/store'
export const indexRouter = Router()
indexRouter.get('/', async (_req, res, next) => {
try {
const manifest = await loadRootManifest()
res.render('index', {
packs: manifest.packs
})
} catch (error) {
next(error)
}
})
indexRouter.get('/manifest.json', (_req, res) => {
res.sendFile(path.resolve(manifestRootPath))
})
indexRouter.get('/api/releases', async (_req, res, next) => {
try {
const releases = await fetchReleaseVersions()
res.json(releases)
} catch (error) {
next(error)
}
})