Skip to content

Commit

Permalink
add missing methods
Browse files Browse the repository at this point in the history
  • Loading branch information
Janpot committed Feb 13, 2021
1 parent d2cd5b8 commit f66ec7a
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions packages/next/server/next.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ export class CustomServer {
}
}

logError(...args: Parameters<Server['logError']>) {
if (this.server) {
this.server.logError(...args)
}
}

async render(...args: Parameters<Server['render']>) {
const server = await this.getServer()
await server.render(...args)
Expand All @@ -57,6 +63,26 @@ export class CustomServer {
await server.renderToHTML(...args)
}

async renderError(...args: Parameters<Server['renderError']>) {
const server = await this.getServer()
await server.renderError(...args)
}

async renderErrorToHTML(...args: Parameters<Server['renderErrorToHTML']>) {
const server = await this.getServer()
await server.renderErrorToHTML(...args)
}

async render404(...args: Parameters<Server['render404']>) {
const server = await this.getServer()
await server.render404(...args)
}

async serveStatic(...args: Parameters<Server['serveStatic']>) {
const server = await this.getServer()
await server.serveStatic(...args)
}

async prepare() {
const server = await this.getServer()
await server.prepare()
Expand Down

0 comments on commit f66ec7a

Please sign in to comment.