* Performs a fetch request to the NextInstance with the options provided. * * @param pathname the pathname on the NextInstance to fetch * @param opts the optional options to pass to the underlying fetch * @returns the fetch response
(
pathname: string,
opts?: import('node-fetch').RequestInit
)
| 918 | * @returns the fetch response |
| 919 | */ |
| 920 | public async fetch( |
| 921 | pathname: string, |
| 922 | opts?: import('node-fetch').RequestInit |
| 923 | ) { |
| 924 | try { |
| 925 | this.throwIfUnavailable() |
| 926 | } catch (error) { |
| 927 | Error.captureStackTrace(error, this.fetch) |
| 928 | throw error |
| 929 | } |
| 930 | return fetchViaHTTP(this.url, pathname, null, opts) |
| 931 | } |
| 932 | |
| 933 | public on(event: Event, cb: (...args: any[]) => any) { |
| 934 | if (!this.events[event]) { |