Skip to content

Commit

Permalink
docs: update docs.md
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangyuang committed Aug 5, 2024
1 parent 606a280 commit 7c6d441
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
14 changes: 14 additions & 0 deletions docs/bootstrap.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const { Bootstrap } = require('@midwayjs/bootstrap')
const { loadConfig } = require('ssr-common-utils')

const { serverPort } = loadConfig()

Bootstrap
.configure({
globalConfig: {
koa: {
port: serverPort
}
}
})
.run()
9 changes: 7 additions & 2 deletions docs/config.js → docs/config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
module.exports = {
import type {UserConfig} from 'ssr-types'

exports.userConfig = {
chainBaseConfig: (chain) => {
chain.module
.rule('markdown')
Expand All @@ -7,6 +9,9 @@ module.exports = {
.loader(require.resolve('raw-loader'))
.end()
},
jsInline: 'all',
cssInline: 'all',
dynamic: false,
chainClientConfig: chain => {
chain.optimization
.splitChunks({
Expand Down Expand Up @@ -34,4 +39,4 @@ module.exports = {
})();`
}
]
}
} as UserConfig
2 changes: 1 addition & 1 deletion docs/src/controller/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export class Index {
async handler (): Promise<void> {
try {
const stream = await render<Readable>(this.ctx, {
stream: true
stream: false
})
this.ctx.body = stream
} catch (error) {
Expand Down

0 comments on commit 7c6d441

Please sign in to comment.