```js // @noErrors import { getRequestEvent, read } from '$app/server'; ``` ## getRequestEvent > 自 2.20.0 起可用 返回当前 `RequestEvent`。可在服务器钩子、服务器 `load` 函数、操作和端点(以及由它们调用的函数)中使用。 在无`AsyncLocalStorage`的环境下,必须同步调用(即不在`await`之后)。 ```dts function getRequestEvent(): RequestEvent< Partial>, string | null >; ``` ## 读取 > 自 2.4.0 版本起可用 读取导入资产的文件系统内容 ```js // @errors: 7031 import { read } from '$app/server'; import somefile from './somefile.txt'; const asset = read(somefile); const text = await asset.text(); ``` ```dts function read(asset: string): Response; ```