0.0.4 • Published 20 days ago

@gyron/gdoc v0.0.4

Weekly downloads
-
License
MIT
Repository
-
Last release
20 days ago

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)
    },
  }
}