0.0.4 • Published 20 days ago
@gyron/gdoc v0.0.4
GD
# 初始化项目
gdoc init [options]
# 启动项目
gdoc start [options]
# 构建项目
gdoc build [options]
# 预览项目
gdoc serve [options]
options
import type { RequestHandler } from 'express'
interface Options {
port: number
basePath: string // base path
sourcePath: string // source path
middleware: (output: object) => RequestHandler
}
function defineConfig(): Options {
return {
port: 3000,
basePath: '/',
sourcePath: 'docs',
middleware: (output) => (req, res, next) => {
res.json(output)
},
}
}